Page 2 of 2
Re: turbo integrator rule
Posted: Wed May 19, 2010 2:00 am
by Alan Kirk
angel1234 wrote:hi,
can you please tell me is this the correct syntax of ascii output statement??
asciioutput('F:outputext.txt',dayno(attrs('storename1',type,'startdate');
and please tell me in which tab i should write the statement in advanced area.
thanks and regards,
angel
1/ The path should be F:
\
2/ As I mentioned, you need to convert DayNo to a string. You can't feed a numeric value into AsciiOutput. You can use the Str() function for that, or the NumberToString function.
3/ I count three opening brackets, but only one closing bracket. These have to match.
4/ Is type the name of the store? It looks like an attribute name rather than a store name.
Assuming that the Type variable is correct, the syntax you'd need is:
Code: Select all
asciioutput( 'F:\outputext.txt', NumberToString( dayno( attrs( 'storename1', type, 'startdate') ) ) );
Re: turbo integrator rule
Posted: Wed May 19, 2010 3:29 am
by angel1234
hi ,
when i tried this
asciioutput('D:outputext.txt',numbertostring(dayno( AttrS('storename1',storename,'StartDate'))));
i got a error log like
"lfl","store1","2005-11-12","","2005.",Data Source line (1) Error: MetaData procedure line (9): Invalid real number
please tell me what to do over this???
thanks and regards
'angel
Re: turbo integrator rule
Posted: Wed May 19, 2010 3:33 am
by angel1234
hi,
here storename refers to ti variable which has sample values like 'store1','store2','store3'...etc
thanks and regards
angel
Re: turbo integrator rule
Posted: Wed May 19, 2010 3:36 am
by angel1234
storename is not an attribute 'startdate' and 'enddate' are my attributes and storename refers the names of stores which comes under the hierrachy supermarket
Re: turbo integrator rule
Posted: Wed May 19, 2010 4:11 am
by Alan Kirk
angel1234 wrote:hi ,
when i tried this
asciioutput('D:outputext.txt',numbertostring(dayno( AttrS('storename1',storename,'StartDate'))));
i got a error log like
"lfl","store1","2005-11-12","","2005.",Data Source line (1) Error: MetaData procedure line (9): Invalid real number
please tell me what to do over this???
You'll get that error if the value that your feeding into the DayNo function is not a valid date. For example, if the StartDate attribute of the StoreName element is not populated (it's an empty string), you'll get that as an error.
I suggest adding an output of the attribute value above that line. For example:
Code: Select all
#Tells you what store is being reported
asciioutput('D:\outputext.txt',storename);
# Tells you what the attribute value is, and I'll bet that this store doesn't have one
asciioutput('D:\outputext.txt', AttrS('storename1',storename,'StartDate') );
# This will kick the error if the attribute is invalid. If it's not,
# it'll tell you the date value:
asciioutput('D:\outputext.txt',numbertostring(dayno( AttrS('storename1',storename,'StartDate'))));
Re: turbo integrator rule
Posted: Wed May 19, 2010 5:09 am
by angel1234
hi,
Thank you so much ....
my code is working
actually i was running teh condition like this dayno(today)-( dayno( 'startdate' )) .so in the ascii text its written like 'startdate' instead of my actual date. After i removed my single quotes on startdate its working well
Thanks and regards,
Angel
Re: turbo integrator rule
Posted: Wed May 19, 2010 6:07 am
by monishapm
Thanks to All . Its working now
