Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Hint of the day

Keywords:Hint of the day 

Here's some example code to put a random message out to a user.

First create an INI file, as follows, and save it as MyHints.ini

[main]
hint0="this is hint zero"
hint1="This is hint one"
hint2="This is hint two"
hint3="This is hint three"
hint4="This is hint four"

Next create an WBT file, as follows, and save it as Hint_of_the_Day.wbt

;picks a number between 0-4
num=random(4)

;this concatenates the word "hint" with a random number (ie "hint3")
keyname=strcat("hint",num)

;reads a random ini value
myhint=inireadpvt("Main", keyname, "Default string", "c:\windows\desktop\myhints.ini")

;displays a random hint
message("Todays Hint of the Day",myhint)
exit

Article ID:   W13751
Filename:   Hint of the day.txt