Ubiq Script C Reference Manual V1.01 Content
Total Page:16
File Type:pdf, Size:1020Kb
UbiQ Script C Reference Manual V1.01 Content 1. BASICS OF SMART-C SCRIPT LANGUAGE .........................................................................4 ELEMENTS OF C....................................................................................................................................4 Tokens .............................................................................................................................................4 Comments........................................................................................................................................5 Keywords.........................................................................................................................................5 Constants ........................................................................................................................................6 Hex-decimal Integer Constant ........................................................................................................6 String literals ..................................................................................................................................6 Punctuation and special characters................................................................................................7 PROGRAM STRUCTURE .........................................................................................................................7 The main function and program execution......................................................................................7 Name spaces ...................................................................................................................................8 DECLARATIONS AND TYPES ..................................................................................................................9 Overview of declarations ................................................................................................................9 Type specifiers...............................................................................................................................10 EXPRESSIONS AND ASSIGNMENTS.......................................................................................................10 Operators...................................................................................................................................... 11 Operator precedence.....................................................................................................................12 STATEMENTS.......................................................................................................................................12 block statement .............................................................................................................................13 break statement .............................................................................................................................14 continue statement ........................................................................................................................15 expression statement .....................................................................................................................16 for statement .................................................................................................................................16 if statement....................................................................................................................................17 return statement ............................................................................................................................18 while statement .............................................................................................................................20 FUNCTIONS.........................................................................................................................................21 Overview of functions ...................................................................................................................21 Return type....................................................................................................................................21 Arguments .....................................................................................................................................22 2. FUNCTIONS REFERENCE...........................................................................................................24 SUMMARY TABLES..............................................................................................................................24 SUPPORT FUNCTIONS..........................................................................................................................28 atof ................................................................................................................................................28 atoh ...............................................................................................................................................29 2 atoi ................................................................................................................................................30 close ..............................................................................................................................................31 date ...............................................................................................................................................32 debug.............................................................................................................................................33 eof .................................................................................................................................................34 filecopy..........................................................................................................................................35 ftoa ................................................................................................................................................36 GetScenarioReg ............................................................................................................................37 GetFileFromHttp ..........................................................................................................................38 getenv............................................................................................................................................39 HelpWindow..................................................................................................................................40 itoa ................................................................................................................................................41 LoadBMP......................................................................................................................................42 LoadBMPByValue.........................................................................................................................44 OpenPort.......................................................................................................................................45 open...............................................................................................................................................46 PlaySound .....................................................................................................................................48 printf .............................................................................................................................................49 read ...............................................................................................................................................55 readln ............................................................................................................................................57 seek ...............................................................................................................................................59 sendComData................................................................................................................................61 setdebug ........................................................................................................................................63 SetupTime......................................................................................................................................64 ShowText .......................................................................................................................................65 Sleep..............................................................................................................................................66 sprintf............................................................................................................................................67 strcpy.............................................................................................................................................69 strlen .............................................................................................................................................70 time ...............................................................................................................................................71