Hi ic3_man, welcome to PGD.

Just a couple of recommendation to help you out right off the bat. First, try using the Pascal BBCode tags provided in your reply Toolbar. it'll make the code clearer and easier to view.

Second, I'd suggest you find a good book on the basics of Pascal or better yet, Object Pascal. Whats the difference? One specifically is a more current, Object Oriented Programming (OOP) language and the other is the older, non-OOP version of the same language. As an alternative you can also find some good materials in the PGD Library on the Pascal langage it's self. In fact I'd bookmark it, as you are a beginner these resources will be a great place to get started with.

Lastly, if you are using something like Delphi that has helpfiles included, I'd strongly recommend getting used to the language reference help files. I practically learned most of what I know about the language using Turbo Pascal 7 and Delphi 3 help files.


As for your problem, I'd have gone with a different naming scheme for your procedure's parameters. Because what you have done is altered the local variables instead of the global ones that will stick around after the procedure has closed.

OR you could have done this instead:

[pascal]procedure even(var bet, num, amount: integer; var win: boolean);[/pascal]

Which will allow the procedure to alter the variables passed to it while calling it.

Hope this helps. BTW, what compiler(s) are you using?