> cName := "Bond"; cCity := "Tokyo"
> _SPD( "Hi, I'm %#01s from %#02s.", cName, cCity ) -> "Hi, I'm Bond
from Tokyo"
> _SPD( "Hi, I'm from %#02s, my name is %#01s.", cName, cCity ) ->
"Hi, I'm from Tokyo, my name is Bond"
This is TO DO, do you want do it?
No thanks, I'm doing enough things with Harbour already,
and I personally don't plan to use _SPD().
My problem is that I have limited time, as we all suppose. :)
Yes, we all have limited time.
Brgds,
Viktor
In my case, the necessity of the function is mount SQL sentences in
the same way that in C with some help.
New functionality or improvements in benefits are welcome: this is
Open Source.
About the name I think it should be the Harbour's community who
name, _SPD is just the name that I have given.
Best regards
Xavi
Szakáts Viktor escribió:
Hi Javier,
One more thing (well two).
IMO to make this function more universal and even easier
to use and update (and usable for someone needing it for
translated text formatting), I think it would very
nice if there would be a possibility to specify the
_ordinals_ of those format strings:
cName := "Bond"; cCity := "Tokyo"
_SPD( "Hi, I'm %#01s from %#02s.", cName, cCity ) -> "Hi, I'm Bond
from Tokyo"
_SPD( "Hi, I'm from %#02s, my name is %#01s.", cName, cCity ) ->
"Hi, I'm from Tokyo, my name is Bond"
[ I seem to recall there is a standard way to achieve this
in printf(), but I didn't find any specifics, so I might be
wrong. ]
To bring this to another level - but this is even more
out of scope of this one function -, it would be great
to have something where you can replace _named_ strings:
_FILL( "INSERT INTO stuff ( stuff_ID, stuff_Name ) VALUES
( %stuff_ID%, %stuff_Name% )",;
{ "stuff_ID" => cStuff_ID, "stuff_Name" => cStuff_Name } )
(or something along this line)
This could be useful for a number of purposes. Basically
a light form of template engine. Maybe it would be best
to mimic some existing standards for the format strings.
Brgds,
Viktor
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour