Text is the simplest to do, because it is in ASCII form and the output devices like the monitor and printer are expecting it in ASCII. As in C, Windows is expecting text to be null terminated.
Name | Description | Example |
---|---|---|
ClearScreen | Clear screen and place cursor at start | ClearScreen proc |
locate | Set X Y location of cursor | locate proc x:DWORD,y:DWORD |
StdIn | Get input from console | StdIn proc lpszBuffer:DWORD,bLen:DWORD |
StdOut | Output text at current location | StdOut proc lpszText:DWORD |
StripLF | Strip CRLF from StdIn result | StripLF proc strng:DWORD |
StdErr | Output text to standard out | StdErr proc lpszText:DWORD |
StrToFloat | StrToFloat converts a floating point string to a floating point number. | StrToFloat PROC stdcall public, szIn: PTR BYTE, fpout: PTR QWORD |
FloatToStr/2 | FloatToStr converts a QWORD size floating point value to a string. | FloatToStr PROC stdcall public USES esi edi, fpin: QWORD, szDbl: PTR CHAR |
Name | Description | Example |
---|---|---|
add$ | Concantenate two strings | mov pstr, add$(lpBuffer,lpString) |
append$ | Append a zero terminated string and return next position | mov location, append$(string,buffer,location) |
cat$ | Concantenate multiple strings | mov lpbuffer, cat$(lpBuffer,[variable number of strings]) |
cfm$ | Format a quoted string with C style escapes | print cfm$("\tThis is a test\n\tof the \qfmt$\q macro\n") |
chr$ | Return the address of combined quoted strings and bytes | mov pstr, chr$("quoted text",13,10) |
cmd$ | Return the address of the command line | mov pCmd, cmd$(argument_number) |
hval | Convert hex string to 32 bit integer | mov value, hval(lpString) |
istring | Find a substring in a source string | mov pSubStr, istring(spos, source, sub_string) |
lcase$ | Convert string to lower case | mov lpString, lcase$(lpString) |
left$ | Read characters from left side of string | mov lpString, left$(lpString,slen) |
len | Return the length of a zero terminated string | mov flen, len(lpString) |
ltrim$ | Trim the left side of a string of spaces | mov lpString, ltrim$(lpString) |
ptr$ | Cast a buffer to a pointer | mov lpstring, ptr$(buffer) |
remove$ | Remove sub string from source string | mov lpSource, remove$(lpSource,lpSubString) |
rev$ | Reverse a string | mov lpString, rev$(lpString) |
right$ | Read characters from right side of string | mov lpString, right$(lpString,slen) |
rtrim$ | Trim the right side of a string of spaces | mov lpString, rtrim$(lpString) |
sstr$ | Convert signed 32 bit integer to a zero terminated string | mov lpResult, sstr$(Integer) |
sval | Convert signed string to 32 bit integer | mov value, sval(lpString) |
trim$ | Trim both ends of a string of spaces | mov lpString, trim$(lpString) |
ucase$ | Convert string to upper case | mov lpString, ucase$(lpString) |
uhex$ | Convert unsigned 32 bit integer to a zero terminated hex string | mov lpHex, uhex$(integer) |
ustr$ | Convert unsigned 32 bit integer to a zero terminated string | mov lpResult, ustr$(uInteger) |
uval | Convert unsigned string to 32 bit integer | mov value, uval(lpString) |
Name | Description | Example |
---|---|---|
exist | Test if file exists | exist proc lpszFileName:DWORD |
filesize | Get the disk file size | filesize proc lpszFileName:DWORD | read_disk_file | Read disk file into buffer | read_disk_file proc lpfname:DWORD,lpMem:DWORD,lpLen:DWORD | write_disk_file | Write disk file from buffer | write_disk_file proc lpName:DWORD,lpData:DWORD,fl:DWORD | LoadList | Load files into a list box | LoadList proc hWin:DWORD,pattern:DWORD |
InputFile | Read entire file into a memory buffer | mov hMem, InputFile(lpfile) |
OutputFile | Write a memory buffer to disk | mov rval, OutputFile(lpfile,lpmem,flen) |
fcreate | Create a new file and return its handle | mov hFile, fcreate(filename) |
fdelete | Delete a disk file | cmp fdelete(lpString), 0 |
fopen | Open an existing file and return its handle | mov hFile, fopen(filename) |
fclose | Close an open file handle | fclose hFile |
fread | Read data from an open file | mov bWritten, fread(hFile,lpMemory,bytecount) |
fwrite | Write data to an open file | mov bwritten, fwrite(hFile,buffer,bcnt) |
fprint | Write line of text to an open file | fprint hFile,lptext |
fprintc | Write text to open file with C style formatting | fprintc hFile,"Hi Guys\n" |
fseek | Set the current position in the open file | mov cloc, fseek(hFile,distance,location) |
fseteof | Set the end of the open file to the current location | fseteof hFile |
fsize | Return the size in bytes of the open file | mov flen, fsize(hFile) |