Basic Help Needed 
Author Message
 Basic Help Needed

I know these probs are probably real simple but they are giving me a major
head ache and would apprecate any help on offer.

First up, i have a couple of pushbuttons in a window, when checked, they pass
a value to a variable. I have a second window that i would like to use this
variable value in, but when i state the variable name, RB doesn't know what i
am talking about. How can i make this variable be seen  ?

The second problem, how do i compair this value (if then ?) against a set of
pre difined rules or constants. i.e....

Constants..

Wind  North-bad
                                                East -fair
                                                South-Best
                                                West -Good

variable=wind direction (input n,e,s,w)

Output ??

Please help or the girlfriend will leave me if i run i by her one more
time...

Cheers
Craig



Wed, 01 Dec 2004 05:55:17 GMT  
 Basic Help Needed

Quote:
>First up, i have a couple of pushbuttons in a window, when checked, they
>pass a value to a variable. I have a second window that i would like to use
this
>variable value in, but when i state the variable name, RB doesn't know what
>i am talking about. How can i make this variable be seen  ?

Create a module in your project. Create  your variable as a property in that
module. It will be 'global--you can see it everywhere.

The better solution, though, more in keeping with the spirit of object-oriented
programming, is to create the variable as a property in the Window class of the
second window. Then int he pushbutton's Action event, say

theSecondWindow.theproperty=whatever

Quote:
>Constants..

>Wind  North-bad
>                                            East -fair
>                                            South-Best
>                                            West -Good

>variable=wind direction (input n,e,s,w)

>Output ??

You could do that as a function, which accepts a single parameter and returns a
string value.

--
"Quand la morale triomphe, il se passe des choses tres vilaines."
Literature. Art. Photography. Forums. Shareware. Kink. Sex.
All at: http://www.xeromag.com/franklin.html



Wed, 01 Dec 2004 07:53:27 GMT  
 Basic Help Needed
On Fri, 14 Jun 2002 23:53:27 +0000, Tacit wrote

Quote:
>> First up, i have a couple of pushbuttons in a window, when checked, they
>> pass a value to a variable. I have a second window that i would like to use
> this
>> variable value in, but when i state the variable name, RB doesn't know what
>> i am talking about. How can i make this variable be seen  ?

> Create a module in your project. Create  your variable as a property in that
> module. It will be 'global--you can see it everywhere.

> The better solution, though, more in keeping with the spirit of
> object-oriented
> programming, is to create the variable as a property in the Window class of
> the
> second window. Then int he pushbutton's Action event, say

> theSecondWindow.theproperty=whatever

>> Constants..

>> Wind  North-bad
>>                                                East -fair
>>                                                South-Best
>>                                                West -Good

>> variable=wind direction (input n,e,s,w)

>> Output ??

> You could do that as a function, which accepts a single parameter and
> returns a
> string value.

Thanks, the first part was a great help, i think i was over complicating
things.
Not sure i understand the second part though, could you show an example ?


Sun, 05 Dec 2004 22:34:34 GMT  
 Basic Help Needed
Not sure exactly what it is you want, but if you only want to return bad, fair, best or good, I would suggest using a
simple Select Case statement.

Select Case InputString
Case "North"
        strReturnString="bad"
Case "East"
        strReturnString="fair"
Case "South"
        strReturnString="good"
Case "West"
        strReturnString="best"
End Select

Maybe I understood you wrong, if you could describe in more detail what it is exactly that you want with your program
I'm sure I will be able to help you.
Ciao, Jonck



Sun, 05 Dec 2004 22:46:38 GMT  
 Basic Help Needed

Quote:
>Not sure i understand the second part though, could you show an example
>?

function returnWindValue (windDirection as string) as string

dim returnValue as string

returnValue="bad"

select case windDirection
case "east"
  returnValue="fair"
case "south"
  returnValue="best"
case "west"
   returnValue="good"
end select

return returnValue

--
"Quand la morale triomphe, il se passe des choses tres vilaines."
Literature. Art. Photography. Forums. Shareware. Kink. Sex.
All at: http://www.xeromag.com/franklin.html



Mon, 06 Dec 2004 00:58:55 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Basic help needed using IIOP in VAST 4.5

2. Some basic help need with Clipper 5.3

3. Help! Utter newbie needs help with basic code

4. Newbie needs some basic starting help

5. Need help with basic in Exel

6. Need help in Business Basic and Gentran

7. Need help in Business Basic and Gentran

8. Need help with Crystal Reports for Visual Basic

9. Need Help! with the basics

10. Need Basic Help - Closing a VI

11. Need Help : a basic scheme problem ( thanks in advancd )

12. Need very basic help with $ps_waves.....

 

 
Powered by phpBB® Forum Software