Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Loop question

Author
Message
Random color object
16
Years of Service
User Offline
Joined: 14th Aug 2008
Location: Montreal Canada
Posted: 18th Aug 2008 23:07
Here I found some code here

http://forum.thegamecreators.com/?m=forum_view&t=96075&b=7#post from TDK user.

What I don't understand is this line
I$=Upper$(Inkey$())

Also Is the repeat will go back to DO?

[href]null[/href][href]null[/href]http://forum.thegamecreators.com/?m=forum_view&t=96075&b=7#posthttp://forum.thegamecreators.com/?m=forum_view&t=96075&b=7#post

My actual color is Color object 1, RGB(128,2,3) but I would like it to be random.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Aug 2008 00:12
Inkey$ checks to see if a character key is pressed on the keyboard, and if so, returns it.
Upper$ converts letters to uppercase.
I$ is a string variable.
It's followed by an equals sign, which in this case should be read as 'set I$ equal to the following value'.

So, the command 'I$ = upper$(inkey$())' will get the character pressed, convert it to uppercase, and store the value in variable I$.


Do is the start of an infinite loop, and Loop is the end.
Repeat is the start of a condition loop, and Until is the end. It will loop until the condition checked is true and then continue on to the command after.

Everything I've posted here is in one of TDK's tutorials - the stuff about loops is in the one you directed me to.

Random color object
16
Years of Service
User Offline
Joined: 14th Aug 2008
Location: Montreal Canada
Posted: 19th Aug 2008 01:29
Ok thanks I am native from Autohotkey software and there is some special variables like this to extract caracters.

My actual color is Color object 1, RGB(128,2,3) but I would like it to be random.

Login to post a reply

Server time is: 2024-11-25 18:51:29
Your offset time is: 2024-11-25 18:51:29