It's because the code page. VFP saves regular text files, that's it - ASCII all 
over. But I am pretty sure you can't save this text (use copy/paste):

Ce ți-aș face de te-aș prinde

I expect your prg file to show different characters instead  of ș and ț.

Notepad can save it correctly because it adds an UTF descriptor just at the 
beginning of the text file (if I'm not mistaken - it's a 2 byte descriptor) and 
that instructs future Notepads instances how to handle those characters. 
Unfortunatelly VFP doesn't know how to do that so you have to resort to a way 
to encode such strings into regular ascii chars and back (that's why I 
mentioned STRCONV() earlier).

Bottom line, it's a language issue.

> -----Original Message-----
> From: profoxtech-boun...@leafe.com [mailto:profoxtech-
> boun...@leafe.com] On Behalf Of Steve Ellenoff
> Sent: Friday, January 14, 2011 10:10 PM
> To: profoxt...@leafe.com
> Subject: RE: Differences between EXECSRIPT and Macro Expansion
> 
> You're assumption was right, creating a manual PRG of that line of code will
> not compile.
> 
> Interestingly, the error msg is different; it gives "Command contains
> unrecognized phrase/keyword." when trying to compile, rather than the
> "Syntax Error" you get when running the command through EXECSCRIPT().
> 
> Since the code is part of a large framework, I'll just keep the Macro
> expansion version in there instead, but it's good to know why there were
> differences in handling.
> 
> Thanks for the explanation.
> -Steve
> 
> 
> At 11:40 AM 01/14/2011, you wrote:
> >VFP's ExecScript actually creates a prg file on disk and compiles it on
> >the fly, so I suspect the text file created cannot handle the
> >characters. I would test this by creating a prg that actually creates a
> >file on disk , containing the text you just posted, and see if it gets
> >created correctly (the characters are identical). I expect it to not.
> >If that's the case and you really want to go with ExecScript, the only
> >way I see is to use StrConv() to convert that value to hex and back
> >from hex in the SQL command. If it does save correctly, though, it
> >means it's something else and in that case I would like to see the code
> >that generates that command. Maybe the value has an apostrophe in it
> >now and then? > -----Original
> >Message----- > From:
> >profoxtech-boun...@leafe.com
> >[mailto:profoxtech- > boun...@leafe.com] On Behalf Of Steve Ellenoff >
> >Sent: Friday, January 14, 2011 6:30 PM > To: profoxt...@leafe.com >
> >Subject: Re: Differences between EXECSRIPT and Macro Expansion > > I
> >forgot to mention that the problem is related to the "funky" characters
> >of > the password field. > > The password field is being encrypted, and
> >that value is causing the > EXECSCRIPT to fail. > > If you blank out
> >that value in the INSERT string, EXECSCRIPT works fine.. I am >
> >wondering why? > > TIA- > -Steve > > At 11:26 AM 01/14/2011, you
> >wrote: > >Can someone explain why the following code fails to work
> >using > >EXECSCRIPT but works in macro-expansion? > > > >tcSQL =
> >[INSERT INTO webaccess > >(AENABLED,FKID,LASTMOD,LASTUSER,LOGI
> >N,PASSWORD,PERSTYPE,UNIQU > EID) > >VALUES
> >(1,'_34I18SAUJ',{^2011-01-13 > >21:10:34},'_06L0T
> >TTG4','2011CN140-001','Š/bvmpsA˜œ†}:Âs','C','_34I18SAUQ
> > > >')] > > > >*Code below failss with a syntax
> >error > >EXECSCRIPT(tcSQL) > > > >*Code below succeeds and correctly
> >inserts the record with all fields > >&tcSQL > > > > > >TIA- > >Steve >
> >> > >
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/000001cbb445$ce85cf10$6b916d30$@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to