C++ Game Development

Moderators: Lundin
Number of threads: 236
Number of posts: 517

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Lil help with login screen Posted by Zaerough on 20 Oct 2003 at 4:29 PM
This message was edited by Zaerough at 2003-10-20 17:37:40

This is what I have so far, if its lacking please bare with me I learn from working examples and I don't have any.

{
Do
strLoginID = InputBox("Enter your ID")
}

I really dont think any of that is right but when I find something on the net I have to try to work with it as is.
Report
Re: Lil help with login screen Posted by AsmGuru62 on 3 Nov 2003 at 8:21 AM
: This message was edited by Zaerough at 2003-10-20 17:37:40

: This is what I have so far, if its lacking please bare with me I learn from working examples and I don't have any.
:
: {
: Do
: strLoginID = InputBox("Enter your ID")
: }
:
: I really dont think any of that is right but when I find something on the net I have to try to work with it as is.
:
You have to do some checking if the password is a correct one or you will be in a loop forever...
int iAttempts = 3;
int pass = 0;
char* pstrLoginID;

while (iAttempts--) {
  pstrLoginID = InputBox ("Enter your ID: ");
  if (strcmp (pstrLoginID, "...a correct password here...") == 0) {
    pass = 1;
    break;
  }
}

if (! pass) {
  // after three attempts - NO PASS!
}
else {
  // ACCEPTED!
}




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.