01.09.2014 Views

WM Basic™ User's Manual - Classes

WM Basic™ User's Manual - Classes

WM Basic™ User's Manual - Classes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

318 Working Model Basic <strong>User's</strong> <strong>Manual</strong><br />

Example<br />

'This example creates a test file, writes ten records into it,<br />

'then finds the length of the file and displays it in a message box.<br />

Const crlf = Chr$(13) + Chr$(10)<br />

Sub Main()<br />

a$ = "This is record number: "<br />

See Also<br />

Platform(s)<br />

Log (function)<br />

Syntax<br />

Description<br />

Open "test.dat" For Random Access Write Shared As #1<br />

For x = 1 To 10<br />

rec$ = a$ & x<br />

put #1,,rec$<br />

msg = msg & rec$ & crlf<br />

Next x<br />

Close<br />

Open "test.dat" For Random Access Read Write Shared As #1<br />

r% = Lof(1)<br />

Close<br />

MsgBox "The length of test.dat is: " & r%<br />

End Sub<br />

Loc (function); Open (statement); FileLen (function).<br />

Windows and Macintosh.<br />

Log(number)<br />

Returns a Double representing the natural logarithm of a given number.<br />

Comments The value of number must be a Double greater than 0.<br />

Example<br />

See Also<br />

Platform(s)<br />

The value of e is 2.71828.<br />

'This example calculates the natural log of 100 and displays it in<br />

'a message box.<br />

Sub Main()<br />

x# = Log(100)<br />

MsgBox "The natural logarithm of 100 is: " & x#<br />

End Sub<br />

Exp (function).<br />

Long (data type)<br />

Syntax<br />

Windows and Macintosh.<br />

Long

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!