Rockwell-automation 2708-NBD VBASIC Language Development Kit Instrukcja Użytkownika Strona 56

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 84
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 55
A-B VBASIC and Visual BASIC
Appendix B
Differences Between
B8
may not return the same file numbers, even in identical programs. Just
because a file number is unassigned does not imply that a new file can be
created. There is a maximum number of files which can exist, open or not.
See the Limits section for specifics on A-B VBASIC file and device
limitations.
IF NumFilesOpen < 15 THEN NextFileNum = FREEFILE
FUNCTION name[(parameterlist)][STATIC]
Declares the name, the parameters, and the code that form the body of a
FUNCTION. The appearance of a FUNCTIONs name on the right side of an
= or in an argument list, is considered to be a call to that function, with or
without an (argument list). Do not use FUNCTION procedures that
perform I/O in I/O statements.
CurrTime$ = GetTime$
FUNCTION GetTime$()
GetTime$ = TIME$
END FUNCTION
GET [#]filenumber[,[recordnumber][,variable]]
Reads data from a file in memory into a variable. All 3 items after GET are
required, however the record number can be consecutive commas as in, GET
#1,,V$. See the chapter on Special Devices for details about input from
specific devices. FIELD is not supported, use TYPE..END TYPE.
TYPE EmpType
Badge AS STRING * 8
Name AS STRING * 25
END TYPE
DIM SHARED Emp AS EmpType
OPEN EMPLOYEE FOR RANDOM AS #1 LEN = LEN(Emp)
Rec = 0
DO WHILE NOT EOF(1)
Rec = Rec + 1
GET #1, Rec, Emp
IF Emp.Badge = BadgeInput$ THEN Found = TRUE: EXIT DO
LOOP
CLOSE #1
GOSUB {linelabel | linenumber}....RETURN
Branches to and returns from a subroutine. Linelabel on RETURNs are not
supported in A-B VBASIC. BASICs SUB and FUNCTION procedures
provide a more wellstructured alternative to GOSUB...RETURN
subroutines.
DO
CurrTime$ = LEFT$(GetTime$,4)
IF CurrTime$ > OldTime$ THEN
GOSUB UpdateTime
OldTime$ = CurrTime$
Przeglądanie stron 55
1 2 ... 51 52 53 54 55 56 57 58 59 60 61 ... 83 84

Komentarze do niniejszej Instrukcji

Brak uwag