Source language: Translate to:

Not more than 3

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Not more than 3

Postby Alex » Fri Jan 12, 2007 11:30 am

Hi,

How can I do when I click more than 3 times on the push button to have a AlertBox who it's write : Not click than 3 times.

According to me, I need a Variable it tells how many times I push the Button.


Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Gaev » Fri Jan 12, 2007 12:01 pm

Alex:
According to me, I need a Variable it tells how many times I push the Button.
... say you want to store this information in variable called [ClickCounter] ... then in the Click section of the Button object ...
Code: Select all
If "[ClickCounter]" "=" ""
   SetVar "[ClickCounter]" "1"
Else
   SetVar "[ClickCounter]" "[ClickCounter]+1"
EndIf
How can I do when I click more than 3 times on the push button to have a AlertBox who it's write : Not click than 3 times.
... first add this to the above code ...
Code: Select all
If "[ClickCounter]" "<" "4"
   Return
EndIf
AlertBox "Error" "You have now clicked more than 3 times !!!!"
... you did not say what you want to do with the counter afterwards ; if you want to reset it after displaying error message, add this line too ...
Code: Select all
SetVar "[ClickCounter]" ""
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby smartmedia » Fri Jan 12, 2007 12:05 pm

Hi...

Put the code in a button and run it...

Code: Select all
SetVar "[Count]" "[Count]+1"
if "[Count]" ">" "3"
AlertBox "[PubTitle] - Information" "Don't click than 3 times."
SetVar "[Count]" "0"
endif

I hope i help you...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Alex » Fri Jan 12, 2007 2:20 pm

Thanks,

I was mistaken, it's not a PushButton but a text in a Variable, for example, if there is 3 times of continuation the word JUS, a AlertBox open and say : NOT MORE THAN 3 TIMES !!


Thanks
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Alex » Mon Jan 15, 2007 12:55 pm

Hello !!!
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Sam Cox » Mon Jan 15, 2007 1:02 pm

Hello Alex,

Please provide a few more examples. I understand that you want to avoid more than three repetitions of a word, but do you mean specific words or all words? How many different words? Three repetitions in a row (that is, next to each other) or anywhere in the text? How long can the text be? Do you want or need to solution to be "real time" (that is, while the user is typing), or can we wait for the use to press a button to begin counting?

-- Sam
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

Postby Alex » Tue Jan 16, 2007 10:23 am

Hi,

Look, When I have Push the button, there is wrotten in [Result] : JUS
because : setvar "[Result]" "JUS"
So when, in the variable [Result] there is in 3 times always JUS, a message box is coming and say : Not more than 3


But it work for all word, for example, if a replace the word JUS by HUG, it works, because the PushButton is not working just for the word JUS but for all word, when it know that is the 3 times that I push the button with the same word, it says stop.

In my PushButton I have a lot of word : JUS; HUG; DFR; KIT; AZD ...
So it can know which word was took and how many times




Thanks
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Neobook » Wed Jan 17, 2007 11:39 am

Good Idea Alex, but I don't know how to do
Neobook
 
Posts: 131
Joined: Sat Jul 01, 2006 7:07 am

Postby Alex » Thu Jan 18, 2007 10:36 am

OK,

Thanks

Help !!
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Gaev » Thu Jan 18, 2007 11:10 am

Alex:

Perhaps others are too polite to say this but ... it is not that people do not want to help you ... rather (speaking for me) it is difficult to understand what problem you are trying to solve.

I think there are two issues you need to address ...

a) be a lot more descriptive with the definition of the problem at hand ... wrap your description around the objects you have e.g. Push Button Button23 or TextEntry Box TextEntry14 ... and tell us what [variables] are associated with each of them ... and post the NeoBook actions currently in use in the Event sections (like Click or TextChange etc.) of these objects

b) a number of your messages get lost in the translation ... assuming your first language is French or Spanish, perhaps you can post your problem first in those forum sections ... and ask one of our bi-lingual members to kindly translate into English ... otherwise, see if this mechanical facility helps ... http://world.altavista.com/

There are many people on the forum willing to suggest solutions to your problem ... once they understand what it is ... but it gets frustrating when we spend time chasing the right answer to the wrong problem.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Neobook » Thu Jan 18, 2007 12:19 pm

Hi,

I'm very sorry.

I have a lot of words in my program, for example JUS or HGR.

When I click of the push button (PushButton1) there is 1 word, took with the hazard, in the variable [Result].

When there is 3 times of continuation the same word, a message box came and say : "You lose !"


I hope you understand


Thanks

Alex
Neobook
 
Posts: 131
Joined: Sat Jul 01, 2006 7:07 am

Postby Gaev » Thu Jan 18, 2007 12:32 pm

Alex (NeoBook ? ... do you have two userid's ?)
I hope you understand

- No, I don't ... you need to be A LOT MORE VERBOSE !!!
- I am not psychic ... and I do not have the time to pull out all the details from you
- Hope someone else can help you
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Neobook » Thu Jan 18, 2007 12:37 pm

Neobook is my brother, I was of his count
Neobook
 
Posts: 131
Joined: Sat Jul 01, 2006 7:07 am

Postby Alex » Thu Jan 18, 2007 1:52 pm

So, now I am Alex, I found how to do for the variable :

Setvar "[hughj]" "[szTemp]"
If "[Result]" "=" "[hughj]"
If "[ClickCounter]" "=" ""
SetVar "[ClickCounter]" "1"
Else
SetVar "[ClickCounter]" "[ClickCounter]+1"
EndIf
If "[ClickCounter]" "<" "3"
Return
EndIf
AlertBox "How long I still will repeat this word ?"
SetVar "[ClickCounter]" ""
EndIf


It works very well, I used your code Gaev.

Thanks

And excuse me for the accident


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest