Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
9
Erster Beitrag:
vor 4 Jahren, 11 Monaten
Letzter Beitrag:
vor 4 Jahren, 11 Monaten
Beteiligte Autoren:
Tor-Bjarne, Alexandre Leclerc, Piet van Zanten, Bart VDE, Christoph Erdmann, Fabrice Harari, GuenterP

define integer variables

Startbeitrag von Tor-Bjarne am 28.05.2013 21:41

Hi,

I cant seem to find out how I define the more "exotic" variables in windev v17?

If I where to define a "unsigned 8-byte int" I would expect something like:

test is unsigned 8-byte int


But windev gives me error on this (test is unsigned 8-byte int), (And yes, I have tried to search the help)

The help talks about all types of variables but not how to declare them.? - or have I read the wrong chapter? :)

Cheers
Tor-Bjarne

Antworten:

Hi

I do not have my help file on me, so from the top of my head, it would be:
ui8Test is unsigned int on 8

and yes, it's in the help, but again, I cannot tell you where right now as...well you know...

Best regards

von Fabrice Harari - am 28.05.2013 22:05
Hi Tor-Bjarne,

IntGenNumber is 4-byte unsigned int

is working. For arrays:

StdColorFG is array of 24 4-byte unsigned int

von GuenterP - am 29.05.2013 06:43
Hi,

i have test this :

for xxx = 1 to 10
beep
end

Never declare this variable "xxx" and never use this variable in the program. Is there a automatic in WinDev 18 to declare variables ? I test this code without any error. Come from Windev 8 and there this is not possible.

Tor-Bjarne, I know this is not the correct answer off your question.

Christoph

von Christoph Erdmann - am 29.05.2013 09:11
Quote
Christoph Erdmann
Hi,

i have test this :

for xxx = 1 to 10
beep
end

Never declare this variable "xxx" and never use this variable in the program. Is there a automatic in WinDev 18 to declare variables ? I test this code without any error. Come from Windev 8 and there this is not possible.

Tor-Bjarne, I know this is not the correct answer off your question.


Christoph



Hello,

In the help for the for-statement :

:
Scalar simple variable (integer or real).
There is no need to declare this variable. Indeed, this variable is automatically declared.

Regards,
Bart

von Bart VDE - am 29.05.2013 09:43
Hi,

First Thank to all that replied :)

Usually I go for an int and that`s it, Now I need more and I will explain why I need examples of how to define all types possible in WinDev:

Im building a simple label program, where what fields (and values) that can be transfered can be changed run-time in a LabelDefinition.

First retrive all fields and type from a table (or more) using the HListItem({idbTable}, hLstDetail) command.
(I would like to specify the table at run-time also)

When parsing the list returned from HlistItem I "can" receive ut to 31 different WinDev field/variable types.

These types I make "Windev source" of, in a self-build method (AddField) in the form "Table_field is "type" = "Value#" "

This way it is possible to make run-time expressions with the fields in my "LabelDefinition.txt" file as this is parsed and calculated before before printout. (Intermec P4) using ExecuteCode() function of windev.

My problem was/is: I did not find (in the help) how to declare the different types when building the string.

I`ve read the chapter "Simple variables" stating 2-4-8 byte int variables is possible but not how or any link/example except for "nVar is int", same goes for the different types of real/currency datetime (long short) etc. I guess.

@christop - Yes Windev lets you define variables in a for each, they are just valid within the scope of the for each.
For i = 1 to 100
End
The i = int var is just valid between the for and the end, same goes for
For each string MyString of LongTextVar separated by ";"
End
where MyString is declared as a string and used between for/end :)

Cheers
Tor-Bjarne

von Tor-Bjarne - am 29.05.2013 10:04
Hi Tor-Bjarne,

I made me notice that in the French documentation if you copy-paste the integer type as expressed in the help: "Entier sans signe sur 1 octet" it is converted correctly in English as "4-byte unsigned int".

But if you copy-paste what is in the English help "Unsigned 4-byte integer" this is incorrect (it should be "4-byte unsigned int"). A suggestion could be made to correct the declarations in the help to make it obvious.

Int are incorrect: http://doc.pcsoft.fr/en-US/?1514049
Reals are correct: http://doc.pcsoft.fr/en-US/?1514048
Strings are correct: http://doc.pcsoft.fr/en-US/?1514044

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 29.05.2013 12:32
Hi,

Thank you :)

Cheers
Tor-Bjarne

von Tor-Bjarne - am 29.05.2013 12:44
Hi Tor-Bjarne,

I'm assuming you are referring to a memory table.
In that case you could translate all the different numeric types into a display mask, based on the maximum length and the number of decimals with a SWITCH - CASE.
And make your table use this display mask for each column.

Regards,
Piet

von Piet van Zanten - am 29.05.2013 13:25
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.