--- In [email protected], "brucexs" <[EMAIL PROTECTED]> wrote:
>> But I realised after posting you that I could workaround like this
>>
>> sDummy = repeat(" ", iCount+1)
>> ppsv->SetVar(szVarName, sDummy);
>> pvar = ppsv->GetVarAddr(szVarName)
>> if (pvar)
>> memcpy(pvar, val, iCount)
>>
>> Which is what I'll do for now. Would setbug by necessary or
>better?
>
>The above would work if you are asking user to reserve right buffer
>size, ie
>myVar = repeat(" ", iCount+1) ;; +1 may be unneeded
>plugin.service("myVar", iCount)
Sorry, I meant pseudocode within plugin like this:
char* pszTemp = ppsv->AllocTemp(iCount);
memset pszTemp to all blanks
put a final \x00 byte at end
ensure var exists, if not declare it global with ppsv->runCmd
SetVar the var to pszTemp
pvar = ppsv->GetVarAddr(szVarName)
if (pvar)
memcpy(pvar, val, iCount)
>But if try to run the assignment from your plugin, it will cause an
>error if myVar is undeclared and user has selected error in this
>case. (Although if you do not mind this error, then it should work).
I can either demand user have already declared var, or do it myself
from within plugin
>Also, I think you want to replace first two lines of yours above
>with something that does an runcmd of assignment of passed variable
>name with repeat(" ", iCount+1)
Yeah, sorry, meant to to it all within plugin, as above
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/JV_rlB/TM
--------------------------------------------------------------------~->
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/