Q: new user questions 
Author Message
 Q: new user questions

I'm trying my first program and have a few questions.

1. The user types a number in an editfield that will be
used in a calculation. I need to use the individual digits
to perform the calculation, so instead of using integer
division, I use the Mid function to break up the string
then use the Val function to convert each to a number.
Unfortunately, Val of any non-numeric character
evaluates to zero. If I use the ASC function to compare
the value of the character to the ASCII value of zero,
I can filter out the non-numeric input for the Mac
compile of my program, but it doesn't work for the
Windows compile. Is there an easier way to validate
numeric data? (I've had introductory classes in VB,
this would have been easy with "IsNumeric").

2. In one window, the user has to select from one
of several radio buttons. There are ten buttons,
numbered from 0 to 9. Since I prefer to use
keyboard input rather than mouse clicks, I've used
the Keydown to allow the user to type the number
of the selection. Again, this works fine in the Mac
compile for both sets of numeric keys, but in the
Windows compile, it ignores the numeric keypad.
Are there different key values for the numeric
keypad on a Windows box? If I can't get around
this one I'll just ignore it since most of my users
aren't likely to think of typing the first digit of
the selection instead of using their mouse.

3. (Here's where you can see that I'm a beginner)
I need to pass a variable from one window to another.
I can't find this described in the documentation, but
I have seen that you can use "window.object.property"
format to reference object properties in another
window. How do I pass a variable though? If it's in the
docs, a pointer to the proper page would be helpful.

thanks!
wayne



Sat, 22 Mar 2003 09:52:25 GMT  
 Q: new user questions
wayne ingalls wrote :

Quote:
> I'm trying my first program and have a few questions.

> 1. The user types a number in an editfield that will be
> used in a calculation. I need to use the individual digits
> to perform the calculation, so instead of using integer
> division, I use the Mid function to break up the string
> then use the Val function to convert each to a number.
> Unfortunately, Val of any non-numeric character
> evaluates to zero. If I use the ASC function to compare
> the value of the character to the ASCII value of zero,
> I can filter out the non-numeric input for the Mac
> compile of my program, but it doesn't work for the
> Windows compile. Is there an easier way to validate
> numeric data? (I've had introductory classes in VB,
> this would have been easy with "IsNumeric").

> 2. In one window, the user has to select from one
> of several radio buttons. There are ten buttons,
> numbered from 0 to 9. Since I prefer to use
> keyboard input rather than mouse clicks, I've used
> the Keydown to allow the user to type the number
> of the selection. Again, this works fine in the Mac
> compile for both sets of numeric keys, but in the
> Windows compile, it ignores the numeric keypad.
> Are there different key values for the numeric
> keypad on a Windows box? If I can't get around
> this one I'll just ignore it since most of my users
> aren't likely to think of typing the first digit of
> the selection instead of using their mouse.

> 3. (Here's where you can see that I'm a beginner)
> I need to pass a variable from one window to another.
> I can't find this described in the documentation, but
> I have seen that you can use "window.object.property"
> format to reference object properties in another
> window. How do I pass a variable though? If it's in the
> docs, a pointer to the proper page would be helpful.

> thanks!
> wayne


1. if mid(me.text,i,1)=str(val(mid(me.text,i,1))) then 'If it is a
digit, "2"=str(val("2")); If it's anything else, "A"<>str(val("A")):
"A"<>"0"

Something like that?

2. Is num lock not activated?

3. I don't know the help page, but a variable (Should be a property) can
be modified like this:

AnotherWindow.LastSelection=8 'This modify a property 'LastSelection' to
8

Hope this help.



Sat, 22 Mar 2003 03:00:00 GMT  
 Q: new user questions

Quote:

>1. if mid(me.text,i,1)=str(val(mid(me.text,i,1))) then 'If it is a
>digit, "2"=str(val("2")); If it's anything else, "A"<>str(val("A")):
>"A"<>"0"

>Something like that?

Perfect! I like it, it's a very simple solution. I hope to be able to
come up with ones like that on my own soon. Now my app can
do numeric data validation on both mac and pc. Thank you!

Quote:
>2. Is num lock not activated?

It doesn't matter whether num lock is on or off (or caps lock for
that matter) - the numeric keypad on a pc doesn't respond, but
it does work on a mac. Does anyone else have any ideas how to
recognize keystrokes from a pc's numeric keypad?

Quote:
>3. I don't know the help page, but a variable (Should be a property)
>can be modified like this:

>AnotherWindow.LastSelection=8 'This modify a property 'LastSelection'
>to 8

I wanted to be able to pass a variable between two windows, but I still
can't do it. As your example shows, it's possible to modify a property.
I had already done that by assigning my variable's value to an invisible
editfield. It works, but it's a kludge. I'd like to find a more elegant way
to do it. So I'm still open for suggestions.

Thanks again for the great answer to (1) above!

wayne



Sat, 22 Mar 2003 03:00:00 GMT  
 Q: new user questions
Hi All ...
Probably a silly question ... I have a lot of pictures in a window stacked
vertically and I want to be able to scroll the window down to see all of
them, like a multiline editfield. I need the scrollbar code, any
suggestions?
TIA
Tom Cunningham


Tue, 01 Apr 2003 03:00:00 GMT  
 Q: new user questions
I've made a scrollbar class that uses your own custom bar made in your
flavourite graphics program. It uses two picts for the end and one for the
middle so you wont be able to duplicate the 4 lines in the middle of an OS
scroll bar. And you'll have to put the arrows at the end yourself if you
want that.
But I just looked and RB has a scollbar in its tools palette; can't you use
that?
let me know if you want the class.

-laz

Quote:

> Hi All ...
> Probably a silly question ... I have a lot of pictures in a window stacked
> vertically and I want to be able to scroll the window down to see all of
> them, like a multiline editfield. I need the scrollbar code, any
> suggestions?
> TIA
> Tom Cunningham



Wed, 02 Apr 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Qs for SPARC Lisp Users

2. New newbies Qs on Ruby

3. New User Question

4. 2 Basic questions from a new user

5. Question on Clarion 5 and Internet (i am new user)

6. New Clarion User. I have a graphics question

7. Questions from new cw2.0 user

8. New forth user question

9. Screen load order? -- New user question

10. New User Question

11. new user questions

12. Forwarded Re: Fw: Re: Windows questions: New user

 

 
Powered by phpBB® Forum Software