Rockwell-automation 1746-BAS BASIC LANGUAGE User Manual Page 245

  • Download
  • Add to my manuals
  • Print
  • Page
    / 280
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 244
Publication 1746-RM001A-US-P
String Functions 15-3
Example
>1 REM EXAMPLE PROGRAM
>10 STRING 200,20
>20 $(1) = “How are ”
>30 $(2) = “you?”
>40 PRINT “BEFORE ”
>50 PRINT “$(1) = ”,$(1)
>60 PRINT “$(2) = ”,$(2)
>70 PUSH 2 : REM STRING NUMBER TO BE APPENDED
>80 PUSH 1 : REM BASE STRING NUMBER
>90 CALL 61 : REM INVOKE STRING APPEND ROUTINE
>100 PRINT “AFTER:”
>110 PRINT “$(1) = ”,$(1)
>120 PRINT “$(2) = ”,$(2)
>130 END
READY
>RUN
BEFORE:
$(1) = How are
$(2) = you?
AFTER:
$(1) = How are you?
$(2) = you?
READY
>
CALL 62 – Number to
String Conversion
Purpose
Use CALL 62 to convert a number or numeric variable into a string. You must
allocate a minimum of 14 characters for the string. If the exponent of the value to
be converted is anticipated to be 100 or greater, you must allocate 15 characters.
Error checking traps string allocation of less than 14 characters only. There are no
output arguments.
Syntax
PUSH [number to convert to string]
PUSH [string number to receive the value]
CALL 62
Page view 244
1 2 ... 240 241 242 243 244 245 246 247 248 249 250 ... 279 280

Comments to this Manuals

No comments