PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Passing Filename as parameter
Passing Filename as parameter
Débuté par DT, 04 juin 2003 12:36 - 3 réponses
Posté le 04 juin 2003 - 12:36
Hi All

I am writing a global procedure to format Name & Address data (get rid of
empty lines etc)
I have this information in a number of different datafiles (identical format
obviously) so the plan was that I would call the procedure sending 2 parameters,
"p_Filename" and "p_RecordISN"

Hfilter, HreadFirst and HReadNext all accept the p_Filename parameter and
return the correct record(s)
The problem arises if I try to use the data
sTextString = p_Filename.Address1 for example results in an error regarding
the .
I have tried various combinations of "" without success

Substituting the p_Filename for the actual filename to populate sTextString
works as expected

Any ideas - or better still a solution

Regards

DT
Posté le 04 juin 2003 - 12:48
"DT" <derek.theobald@dolgader.co.uk> wrote:

Hi All

I am writing a global procedure to format Name & Address data (get rid of
empty lines etc)
I have this information in a number of different datafiles (identical format
obviously) so the plan was that I would call the procedure sending 2 parameters,
"p_Filename" and "p_RecordISN"

Hfilter, HreadFirst and HReadNext all accept the p_Filename parameter and
return the correct record(s)
The problem arises if I try to use the data
sTextString = p_Filename.Address1 for example results in an error regarding
the .
I have tried various combinations of "" without success

Substituting the p_Filename for the actual filename to populate sTextString
works as expected

Any ideas - or better still a solution

Regards

DT




Here you are with one of my favourite Windev possibilities
(apart from things like dynamic compilation) : 'Indirection'
Look for it in the help ...

example:
-------------------------
sTextString = {p_Filename+".Address1"} //or something
--------------------------

greetings,
Peter
Posté le 04 juin 2003 - 13:44
Peter
Many thanks - your solution (and code example) was correct
Now why did I not think of that?????

I have read the Indirection help, as you say interesting possibilities although
I have somehow to get to grips with the specific uses of " ' and + when constructing
the directives
dynamic compilation - I'm not going to go there, 6 months away from that
one

Regards

DT
Posté le 04 juin 2003 - 20:36
"Peter van Vuuren" <petervu@xs4all.nl> wrote:

"DT" <derek.theobald@dolgader.co.uk> wrote:

Hi All

I am writing a global procedure to format Name & Address data (get rid

of
empty lines etc)
I have this information in a number of different datafiles (identical format
obviously) so the plan was that I would call the procedure sending 2 parameters,
"p_Filename" and "p_RecordISN"

Hfilter, HreadFirst and HReadNext all accept the p_Filename parameter and
return the correct record(s)
The problem arises if I try to use the data
sTextString = p_Filename.Address1 for example results in an error regarding
the .
I have tried various combinations of "" without success

Substituting the p_Filename for the actual filename to populate sTextString
works as expected

Any ideas - or better still a solution

Regards

DT




Here you are with one of my favourite Windev possibilities
(apart from things like dynamic compilation) : 'Indirection'
Look for it in the help ...

example:
-------------------------
sTextString = {p_Filename+".Address1"} //or something
--------------------------

greetings,
Peter



Hi peter, I enjoy you message.

Yes Wd indirections are really good to use. But they are not alone.

want more ? have a look at :
- wd7.5 properties, they covert allmost all what you do with editors... and
more.
- wd7.5 functions hlistxxx or enumxxx (good with indirection)

then, if tou have good naming rules for files and item, you can manage big
processes with small code.

more again ?
data sources that offer realy more than a simple sql result recept. (see
my tutorial at my homepage, in french sorry i cannot translate for the moment)

well very nice thing that make programming a pleasure at times.

One only resting dream : runtime on linux devices...

Good job