CDROM-Guide forums  

PDA

View Full Version : Borland's CBuilder 5 pro - integer input problem


   
procode
Apr 21, 2002, 09:35 AM
My Problem
I need to input an integer variable BEFORE the first frame opens.

I have a 'Message box' opening with brief intructions, could I get this message box to accept an integer, 1, 2, 3 or 4, in order to adjust the skill level before the first form opens ?.

Does anyone know how to put four buttons on the message box instead of the 'close' button ?

Or is there a better way ?

If all else fails, can I have a 'Pre-Screen' form appear that will not interfere with the rest of the program, as the first 'Form1' dynamically allocates memory - and, now that it works, I want to leave it alone.

All helpful suggestions very welcome.
Procode.

Keymaster
Apr 21, 2002, 03:34 PM
Try this link: ***********.codeproject.com/useritems/xmessagebox.asp (you can add radio Buttons to the messagebox).

procode
Apr 21, 2002, 04:18 PM
To keymaster

Thanks for the reply, it looks great for jobs similar to what I need.

But, I could do with quickly getting something simpler, if you know anywhere.

It'll take me at least two weeks to sort out the code on the XMessage Box ?

Procode

procode
Apr 22, 2002, 04:27 PM
In the absence of a better, but just as simple, solution - I've had to settle for an InputBox.

This allows a user text input and I've 'IF-ed' it with a default to get the user inputs I wanted and 'NOT Valid' defaults to the hardest level.

Thanks Keymaster - I'm sure your suggestion would have been better - but time was limited for me.

Over the summer I hope to get to grips with the XMessageBox - it looks good.

Thanks again,
Procode.

Keymaster
Apr 22, 2002, 07:51 PM
Glad you found a workable solution. Don't use CBuilder but you should be able to use an input mask or validation to only accept 1 to 4 as valid (these are Windows GUI standards). The input mask would be easier but may limit you to restricting inputs to a single digit integer only.

procode
Apr 29, 2002, 05:12 PM
It timed me out I think ?

procode
Apr 29, 2002, 05:15 PM
OK keymaster, thanks.

If I had realised at the first development stage, I should have had an initial/Start screen, for future proofing. On that I could have had four icons/buttons with labels giving their skill levels. This would have been very desirable for several reasons.

My time was very limited, so I didn't dare start a major re-build, and risk have no working solution by the delivery date.

My final solution seemed satisfactory to everyone, except me !

History now, but a lesson I've learnt, and one I hope I won't forget, fingers crossed.
I liked the idea of the XMessage box very much.