I see loads of hello world tutorials, but they are only saying such small things, so i will post an hello world tutorial, bit more advanced then others.
lets start!!
have a new project + 1 form ready:
after that, create 2 objects.
1 command button : with text: I am here!
1 label , with no text ( or on form load, label1.caption = "" )
have it somewhat like this:
now, here comes the code:
double click on the command button
then write the following code:
(btw, everything with an ' before it, is a comment)
dim hw as byte
hw = Rnd(1) ' this basicly sets the byte hw to either 1 or 0 ( like an boolean )
'rnd(number) means that the program will generate numbers between 0 and the value you enter in number
'now we do a value check
if hw = 0 then label1.caption = "Hello there!!" else label1.caption = "yo!"
'basicly, you now are asking a question: if hw = 0 "the question", then do, caption = "hello there!!",
'if that question has not the answer we are looking for, then its value is false, and you can use an else action:
'caption = "yo"
ok, this is our code
dim hw as byte
hw = Rnd(1)
if hw = 0 then label1.caption = "Hello there!!" else label1.caption = "yo!"ok, press F5 or the blue arrow, and TEST if it works!
the result will be, that if you press the button multiple times, it will display another text.
now, i want that in the second message, it also gives the current time and date, there are multiple ways to get it, but i do the following:
instead of
else label1.caption = "yo!"
replace it with
else label1.caption = "man, today its " & Now()
'now() is a time format, it gets the current date and time
this will display : man, today its "current time"
after you press multiple times now, you will see, "Hello there!!!", and "man, today its 'current date'"
that was my hello world tutorial
sunreal, fusion universe
FuT, Fusion universe Tutorials