[WebDNA] Function and surviving variables
This WebDNA talk-list message is from 2015
It keeps the original formatting.
numero = 112546
interpreted = N
texte = 114It=E2=80=99s been a while since I messed with the Function function :)Suddenly I remember that I do not recall why a variable inside a =Function can not be used outside the Function.[function name=3Dlib_normal_to_uts][return]
Now:[text show=3Dt]scrubbed_now=3D[getchars =start=3D1&end=3D10][cart][/getchars][/text]
Cart:[text show=3Dt]scrubbed_cart=3D[getchars =start=3D1&end=3D10][db_parent_sku][/getchars][/text]
Since Epoch:[text =show=3Dt]days_since_epoch=3D[math]floor([scrubbed_cart]/86400)[/math][/tex=t]
Diff: [text =show=3Dt]difference_uts=3D[math][scrubbed_now]-[scrubbed_cart][/math][/tex=t]
Days: [text =show=3Dt]difference_days=3D[math]floor([difference_uts]/86400)[/math][/tex=t]
Days Set:[db_parent_days]
Expired:[showif [difference_days]>[db_parent_days]]Yes[/showif][showif [difference_days]=3D[db_parent_days]]Yes[/showif][showif [difference_days]<[db_parent_days]]No[/showif][/return][/function]So why can=E2=80=99t I say [difference_uts] and get the result which was =calculated inside the Function? I need for it to work (including my =brain).Never mind the
=E2=80=99s and stuff - just debug./Palle=---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list
.To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us.
Associated Messages, from the most recent to the oldest:
114It=E2=80=99s been a while since I messed with the Function function :)Suddenly I remember that I do not recall why a variable inside a =Function can not be used outside the Function.[function name=3Dlib_normal_to_uts][return]
Now:[text show=3Dt]scrubbed_now=3D[getchars =start=3D1&end=3D10][cart][/getchars][/text]
Cart:[text show=3Dt]scrubbed_cart=3D[getchars =start=3D1&end=3D10][db_parent_sku][/getchars][/text]
Since Epoch:[text =show=3Dt]days_since_epoch=3D[math]floor([scrubbed_cart]/86400)[/math][/tex=t]
Diff: [text =show=3Dt]difference_uts=3D[math][scrubbed_now]-[scrubbed_cart][/math][/tex=t]
Days: [text =show=3Dt]difference_days=3D[math]floor([difference_uts]/86400)[/math][/tex=t]
Days Set:[db_parent_days]
Expired:[showif [difference_days]>[db_parent_days]]Yes[/showif][showif [difference_days]=3D[db_parent_days]]Yes[/showif][showif [difference_days]<[db_parent_days]]No[/showif][/return][/function]So why can=E2=80=99t I say [difference_uts] and get the result which was =calculated inside the Function? I need for it to work (including my =brain).Never mind the
=E2=80=99s and stuff - just debug./Palle=---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us.
Palle Bo Nielsen
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[Announce]: Web server security and password protection (1997)
no global [username] or [password] displayed ... (1997)
searchable list archive (1997)
using showpage and showcart commands (1996)
Format of Required fields error message (1997)
Am on the list? (1997)
WC2b12: Yes, Formulas.db is for real (1997)
WebCatalog for Postcards ? (1997)
Friday brain fry (2001)
F3 crashing server (1997)
WebCommerce: Folder organization ? (1997)
Showing specific [cart] contents (1998)
Email check problems -1 (1999)
Problem with textA (2000)
[SearchString] (1998)
Date Calulation (1997)
& in Lookups (1997)
[append] and SSL (1997)
[SHOWIF]s and empty arguments (1997)
IE-caching (1998)