PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD7.5] Init an array, "with" type command
[WD7.5] Init an array, "with" type command
Iniciado por cchamberlin, 30,ago. 2003 01:29 - 1 respuesta
Publicado el 30,agosto 2003 - 01:29
Hi all,
Have been enjoying WD, works well. However, is their anyway to set all values in an array (this is an array of structure), without having to do each member individually...I have looked and tryed every word which might be it, but to no avail.
Second item: In Pascal there is a "with" command, which allows you to omit the array when working with the fields within the array....looks like this
....
with somearray[x] do
begin
field1 := "asdf;l" ;
field2 := '123413" ;
etc...
end
instead of:
somearray[x].field1 := "asdf;l" ;
somearray[x].field2 := "123413" ;
etc...
Works the same with database fields.
And yes, I am lazy:)
Ciao,
Craig
Publicado el 31,agosto 2003 - 01:13
Hi Craig,

Have been enjoying WD, works well. However, is their anyway to set all
values in an array (this is an array of structure), without having to do each
member individually...I have looked and tryed every word which might be it,
but to no avail.


I don't think so, you have to go through a loop. Depending on what you want
you can use "RtlZeroMemory" and/or "RtlMoveMemory" API (kernel32).

Second item: In Pascal there is a "with" command, which allows you to omit
the array when working with the fields within the array....looks like this
...
with somearray[x] do
begin
field1 := "asdf;l" ;
field2 := '123413" ;
etc...
end
instead of:
somearray[x].field1 := "asdf;l" ;
somearray[x].field2 := "123413" ;
etc...


Hmmm, not this VB or Pascal possibilities in WD.
So you have to be a little less lazy :-)
(ctrl-V is working well ...)


--
Peter


http://www.xs4all.nl/~petervu