PDA

View Full Version : my first console script :)



Lionheart008
17-02-2009, 12:19
Hi and good morning :)

I have built yesterday evening my first little console script... Have found an old script I have written some years ago for realsoft to show a logarithmus curve... - It's not easy for me to think in console modus, haha :D, I am fully tbgl, ui infected! ;)

I would like to know how I can print my results for the Log line results line per line, then I am happy with my first console script...
after that it would be nice to check if I can show the curve with console modus... (draw?)...

And I would like to know where is the advantage to use for example the relations between 'console/UI' handling???

best wishes, Lionheart with a lot of fun, good mood on a strange new planet :)

Lionheart008
18-02-2009, 11:56
hi all:)

have found what I am looking for... now it's ok:) for me for the first try...

'console_writeLine' is much better than print command, I like it ;)


' Empty ThinBASIC CONSOLE file template
' my first console script:), 16.+17.februar2009

uses "console"

Dim x, y, z As ext
Dim i As Integer

Console_SetScreenBufferSize(80, 65)

Console_WriteLine(" Simple Logarithmus example for CONSOLE by lionheart ")
Console_WriteLine("----------------")
Console_WriteLine("Title : " + Console_GetTitle())
Console_WriteLine("---push key to go forward---")


For i=1 To 20
x = i
y = Log( x )
z = Exp( y )
Console_WriteLine format$("##: ",i)
Console_WriteLine y, "is the log result: ",
Console_WriteLine z
Next
Console_WriteLine("Press any key to exit this example")
sleep 1500

Console_WriteLine("Key pressed " + Console_Waitkey(12))
Console_SetCursorPosition(25, 85)

Console_WaitKey

other things I will learn if there is enough time for it, it was just a good example to handle with uses "console", nice day all, best regards, Lionheart
you can check the example, if the script runs as well as I wish it... or make critics when I have done something wrong:)

ErosOlmi
18-02-2009, 13:14
Lionheart,

in console module there are many ALIAS commands. We develop all those alias to help users to migrate code from different BASIC dialects.

For example the following are exactly the same:
CONSOLE_PRINT
CONSOLE_WRITE
PRINT

The same for:
CONSOLE_PRINTLINE
CONSOLE_WRITELINE
PRINTL

The same for:
CONSOLE_CLS
CLS

The same for:
CONSOLE_WAITKEY
WAITKEY

And so on.
So you can use one set/style or the other.

Ciao
Eros