calculating

You have completed your first interactive designs with QuarkXPress 7, 8 & 9 and now have need for more advanced functionality. Discuss Expressions here, ask questions and learn more about them.
Please note that Flash (SWF) authoring is not supported in QuarkXPress 10 anymore.
Frans van Huizen
Posts: 0
Joined: 12 Jul 2009, 09:16

calculating

Post by Frans van Huizen » 18 May 2010, 02:32

Hi Matthias,Thank you for your reply and all the work.The script works but.... in the outputbox i dont get a four digit number, but only e.g. 0,80 x 20 = 16Do you have an explanation for this?In meen time i will try to figure out the replacement for the period by an comma.Greets Frans

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

calculating

Post by Matthias Guenther (Quark) » 18 May 2010, 02:40

Hallo Frans,
if you always need two decimal digits, how about multiplying the result by a hundred and then inserting the comma before the second last digit? This way you wouldn't even need to do a search for dot and replace by comma.
Thanks
Matthias

Frans van Huizen
Posts: 0
Joined: 12 Jul 2009, 09:16

calculating

Post by Frans van Huizen » 18 May 2010, 03:02

I think that would solve the problem.Is it an option you tell me how to do so :-)))) ?

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

calculating

Post by Matthias Guenther (Quark) » 18 May 2010, 06:38

Hi Frans,
I think you owe me a nice site created with QuarkXPress now ;-)
Change the script to this (red is new):
Reset Object > outbox
Set Expression: calcstring=inbox.GetText()
If Expression: calcstring.IndexOf(",",0) Set Expression: calc=calcstring.Left(calcstring.IndexOf(",",0)).StrToNum() +calcstring.SubStr(calcstring.IndexOf(",",0)+1,1).StrToNum()/10
Else
Set Expression: calc=calcstring.Left(calcstring.IndexOf(",",0)).StrToNum() +calcstring.SubStr(calcstring.IndexOf(",",0)+1,1).StrToNum()/10 +calcstring.SubStr(calcstring.IndexOf(",",0)+2,1).StrToNum()/100
End If
End If
Set Expression: calc=calc*20
outbox.Append(calc*100)
Set Expression: outbox.InsertText(",",outbox.GetText().StrLength-2)
Is that now doing what you want it to do?
Regards
Matthias

Frans van Huizen
Posts: 0
Joined: 12 Jul 2009, 09:16

calculating

Post by Frans van Huizen » 28 May 2010, 22:26

Hi Matthias,Thanks for your help.If you like a preview of the result, check out http://dekker.digital2solutions.nlLet me now your feedback.Now i have to improve the speed of the site.There are two things that dont work properly.The result of your give expression (the total amount) which i like to copy to a hidden field and send to a php script for a e-mail, don't workAnd the text contactperson, wich the user fills in, i like to copy to the last page where i thank the visitor for the use of the site, this expression is also not working.I use the expression:Action: Set TextText Object: Result textfieldMethod: Text Object ContentsText Object 2: Input textfieldPlacement: Replace all

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

calculating

Post by Matthias Guenther (Quark) » 30 May 2010, 22:01

Hi Frans,
nice site. One thing I'd change is the sound, as most people do not like sound from websites. So built a global sound on/off button somewhere.
Can you tell me what exactly doesn't work when sending the data to a php script?
And about copying text from one page to another, you need to either store data in a variable or check the "keep status on page entry" (otherwise the object is reset when it is not on the current page).
Thanks
Matthias

Locked

Return to “Expressions”