Variabel!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Variabel!

Post by jgu1 »

Hi all! :D

I have tried to make a program where I want to enter a value into a variable via a keyboard.

I have tried without success.
Ex. I want to dial 125 in myVar then myVar 125 or (after zeroed Myvar) if I press 53 on the keyboard then myVar 53

First time I press 1 myVar is = 1
second press 2 myVar is = 12
third press 5 myVar is now =125
ect.ect.

is there anyone who has an idea, preferably without using C code.

Thank´s in advance.

Best regard

Jorgen.
Attachments
Myvar.fcf
(10.5 KiB) Downloaded 274 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Variabel!

Post by medelec35 »

Hi jgu1,
Have you tried searching for door lock, as they use a similar method to enter a 3 or 4 digit number then compare it with a stored number to see if correct numbers have been entered.

Martin
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Variabel!

Post by jgu1 »

Hi Martin!

No, good idea, I would do that if this method is the only way. Thank you Martin :D

Best regard

Jorgen.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Variabel!

Post by medelec35 »

your welcome,
If you get stuck I will post something for you.

Martin
Martin

Mikat
Posts: 258
Joined: Wed Nov 29, 2006 6:32 pm
Location: Finland
Has thanked: 7 times
Been thanked: 36 times
Contact:

Re: Variabel!

Post by Mikat »

Hi.
The easy way at short numbers could be like this:
First press
My_var = keyboard * 100
second press
My_var = my_var + (keyboard * 10)
third press
My_var = My_var + keyboard

Or how about an array and pointer?
Like:
Create variables Array_my_var and pointer
Array_my_var[2]
Pointer (byte)
Before first press this
Array_my_var[0] = 0
Array_my_var[1] = 0
Array_my_var[2] = 0
Pointer = 0
Then first press:
Array_my_var[Pointer] = 1
Pointer = Pointer + 1
Then second press:
Array_my_var[Pointer] = 2
Pointer = Pointer + 1
Then third press:
Array_my_var[Pointer] = 5
Pointer = Pointer + 1

Now the Array_my_var is:
Array_my_var[0] = 1
Array_my_var[1] = 2
Array_my_var[2] = 5

Mika

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Variabel!

Post by jgu1 »

Hi Mika! :D

A bit of the same system as Martin described as the combination lock. Thank´s Mika very good explanation. I will test it later today. You will hear from me.

Best regard

Jorgen :o

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: Variabel!

Post by Dan81 »

Hello Jorgen

Try this flowchart.
You will have to test if "number" (integer) > 32767

Daniel
Attachments
keyboard2.fcf
(15.01 KiB) Downloaded 300 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Variabel!

Post by jgu1 »

Hi Daniel!

EXACTLY just what I need! Thank you wery much. :D


Best regard


Jorgen.. :wink:

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Variabel!

Post by medelec35 »

Very clever Daniel.
I do like that method.

Martin
Martin

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: Variabel!

Post by Dan81 »

Hello

The same with "clear" during typing the number

Daniel

PS:
clear : *
enter : #
Attachments
keyboard3.fcf
(15.64 KiB) Downloaded 274 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Variabel!

Post by jgu1 »

Hi Daniel!

Wery nice. It´s also works wery well in real world. Now I will study your flowchart. Thank´s again. :D

Jorgen.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Variabel!

Post by jgu1 »

Hi again!

I like this: Number = (Number * 10) + keypad ( and ofcourse the rest) very, simpel easy and clever. :D

Thank´s

Jorgen.

Post Reply