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.

Dark GDK / how do i compare my input to text to a given text

Author
Message
Herman Burser
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: caloocan city
Posted: 13th Dec 2011 12:17
if(answer==2)
{

dbText(10,100,(msg2));
dbText(10, 200, "Enter text here:");
dbSetCursor(10,240);
sagot2=(dbInput());
dbSetTextSize(16);
dbCenterText(320, 380, "Press any key to continue.");
dbInk(dbRgb(255, 255, 255),dbRgb(0, 0, 0));
dbWaitKey();

if(strcmp (msg2,sagot2) != 0);

dbCenterText(320, 380, "congrats");
dbCLS();


}


//how do i say that msg2 and sagot2 are equal ??
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 13th Dec 2011 18:25


first off, it returns 0 on success, so make it "== 0" instead, and i don't think you want to put the semicolon in there because that's totally useless

Herman Burser
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: caloocan city
Posted: 14th Dec 2011 07:26
ah thankyou sir.. it help me a lot. )

i forget that wenever using "IF" there is no " ; " at the end.

then == instead of !=.


thankyou ...

Login to post a reply

Server time is: 2024-04-24 13:08:09
Your offset time is: 2024-04-24 13:08:09