Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15262 > unrolled thread

ensuring that instructions are performed sequentially

Started byDushan Mitrovich <dushanm@nnips.net>
First post2013-07-30 03:18 +0000
Last post2013-07-30 03:18 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  ensuring that instructions are performed sequentially Dushan Mitrovich <dushanm@nnips.net> - 2013-07-30 03:18 +0000

#15262 — ensuring that instructions are performed sequentially

FromDushan Mitrovich <dushanm@nnips.net>
Date2013-07-30 03:18 +0000
Subjectensuring that instructions are performed sequentially
Message-ID<kt7bad$dkh$1@smc.vnet.net>
I'm trying to write my first, fairly short program in Mathematica  (version 9.0, 
under Mac OS X.6.8) and am encountering problems with instructions not 
being performed in sequence.  I'd appreciate help with straightening me 
out on what I'm doing wrong.

Here are two distilled snippets of the code, presented as two separate 
cells (indicated by the vertical bars on the left):

   | CreateDialog[Grid[{
   |     {"Initial date",
   |      InputField[Dynamic[id], String, FieldHint -> "## Month 20##"]},
   |     {"Forecast start date",
   |      InputField[Dynamic[fs], String, FieldHint -> "## Month 20##"]}
   |     }, Alignment -> Right], Modal -> True]

   | id = Take[ DateList[id], 3]
   | fs = Take[ DateList[fs], 3]

If I evaluate these cells one after the other I get the expected values 
for 'id' and 'fs'.

But if I merge them into one cell and evaluate it, the original 'id' and 
'fs' values show up even before the dialog window, and of course they 
are not updated with the new values.  How do I force sequential 
evaluation here?

The full program has six levels of nesting, so I put it all (100 lines) 
in one cell.  Eventually I'll make it into a CDF file, but meanwhile 
what is the right way to handle this sort of situation?

Thanks.

- Dushan Mitrovich

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web