[Gambas-user] (no subject)
vlahonick vlahonick
tsopanotragi at ...67...
Wed Apr 1 17:44:22 CEST 2009
> From: Karl.Reinl at ...9...
> To: gambas-user at lists.sourceforge.net
> Date: Wed, 1 Apr 2009 17:16:38 +0200
> Subject: Re: [Gambas-user] (no subject)
>
> Am Mittwoch, den 01.04.2009, 17:06 +0300 schrieb vlahonick vlahonick:
> > Thanks you all for your replies....
> > For those that they propuse me to put "end if" at the end of the code of course i did that!!!!
> > In the screenshot i send you all it was just a part of the code,the theme of the screenshot was to show u the error.
> > If i didnt close the code with as many end if were needed the language itself would give me other error that end if are needed.
> > The code i wrote was completely correct,i double-triple checked it...
> > In the screenshot i repeat is just a very small part of my code because i want u to see the error and not the code...
> > Anyway i tried to rewrite my code with the Select Case expression but is more difficult because there are many cases and ONLY
> > one have to be triggered per time and which case should be triggered depends from what the user will wirte...
> > I didnt really succeded to do that with the Select Case expression.
> > So here i give u an example and if someone could help me by writing the same example with the select case expression it will be very helpful.
> >
> > PUBLIC SUB Button1_Click
> >
> > if textbox1.text = "a" then
> > textbox2.text = "b"
> > else
> > if textbox1.text = "b" then
> > textbox2.text = "g"
> > end if
> > end if
> >
> > END
> >
> > (like the example is my program's code-and the events are triggered when the user press the OK button)
> >
> > ty in advance again...:D
>
> Salut,
>
> first: tell us what version of Gambas you are using.
> second: am I right, you are writing a kind of CONVERTER ?
>
> if so this is what I would write quickly.
>
> FUNCTION myConvert(sInChar AS String) AS String
> DIM sRetChar AS String = sInChar ' makes the return value to the given
> value
> ' now make you changes
> IF sInChar = "a" THEN sRetChar = "0"
> IF sInChar = "b" THEN sRetChar = "1"
> IF sInChar = "c" THEN sRetChar = "2"
> IF sInChar = "d" THEN sRetChar = "3"
> IF sInChar = "e" THEN sRetChar = "4"
> IF sInChar = "f" THEN sRetChar = "5"
> IF sInChar = "g" THEN sRetChar = "6"
> IF sInChar = "h" THEN sRetChar = "7"
> IF sInChar = "i" THEN sRetChar = "8"
> IF sInChar = "j" THEN sRetChar = "9"
> IF sInChar = "0" THEN sRetChar = "a"
> IF sInChar = "1" THEN sRetChar = "b"
> IF sInChar = "2" THEN sRetChar = "c"
> IF sInChar = "3" THEN sRetChar = "d"
> IF sInChar = "4" THEN sRetChar = "e"
> IF sInChar = "5" THEN sRetChar = "f"
> IF sInChar = "6" THEN sRetChar = "g"
> IF sInChar = "7" THEN sRetChar = "h"
> IF sInChar = "8" THEN sRetChar = "i"
> IF sInChar = "9" THEN sRetChar = "j"
> RETURN sRetChar
> END
>
> I attached you a test.
>
> --
> Amicalment
> Charlie
First of all thanks you all again about your replies...
But no i am not writing a kind of converter...
Program's idea is to learn greek with an easy method...
And because in greek we dont use latin letters the most important thing is to learn and understand the way the greek letters work...
So for AlMOST every greek letter and difthong in greek exists somekind of a match in latin letters or latin letters combinations...
So the program in a very simple version to understand will have 2 textboxes and an OK button.
So the user will write a greek (or lation) letter in textbox1.text and the result will appear in textbox2.text (or in a label-this doesnt really matters).
So when u press the OK button it has to be triggered ONLY ONE event...!!!
How i do that with SELECT CASE expression?
(when i wrote the whole program with if-then-else-end if i had an error "too many nested control structures" but the code was 200% correct...so any information will be very apprecieted)
============
|textbox1.text|
============
============
|textbox2.text|
============
____
|OK|
ty all for one more time :D
_________________________________________________________________
Show them the way! Add maps and directions to your party invites.
http://www.microsoft.com/windows/windowslive/products/events.aspx
More information about the User
mailing list