Re: [Zope] range with variables
On Tue, 27 Jun 2000, Armin Wappenschmidt wrote: > # <-- that's the problem!! > > > >do something > > > > > > > How can I set the variable "start" from a user given input? If the user input is the value of a field in a form that was submitted, just refer to the name of the form field: You can use the special form name syntax to have Zope cast the field value into the appropriate type: . There's a howto on the various possabilities for what goes after the ':'. --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] R: [Zope] range with variables
Marcel Preda wrote: > > - Original Message - > From: Armin Wappenschmidt <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, June 27, 2000 10:50 AM > Subject: [Zope] range with variables > > > Hi all, > > > > I've a problem using the following dtml construct: > > > > # <-- that's the problem!! > > > > > > > >do something > > > > > > > > > > > > > > How can I set the variable "start" from a user given input? > > > > > The problem is that in both cases the `startindex' is a string, > you have tu convert it to int. > > > The conversion from string to int was the problem. Now it works! :) Thanks! armin -- Armin Wappenschmidt - Consultant Engineer SDRC Ford Program OfficeSDRC Software und Service GmbH Spessartstrasse (D-MD/PA-2) Martin-Behaim-Strasse 12 D-50725 Koeln-Merkenich D-63263 Neu-Isenburg Phone (+49) 0221-90 33619 Phone (+49) 06102-747-0 Fax(+49) 0221-90 31243 Fax (+49) 06102-747 299 PROFS AWAPPENS mailto:[EMAIL PROTECTED] _/_/_/_/ _/_/_/ _/_/_/ _/_/_/_/ _/ _/_/ _/_/_/ _/_/_/_/ _/ _/ _/_/_/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/_/_/_/ _/ _/ _/_/_/_/ S O F T W A R E U N D S E R V I C E G M B H ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] R: [Zope] range with variables
- Original Message - From: Armin Wappenschmidt <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 27, 2000 10:50 AM Subject: [Zope] range with variables > Hi all, > > I've a problem using the following dtml construct: > > # <-- that's the problem!! > > > >do something > > > > > > > How can I set the variable "start" from a user given input? > You can call http://www.domain.com/index?startindex=101 or you can do this bay a usual FORM ... The problem is that in both cases the `startindex' is a string, you have tu convert it to int. ATENTION: If 'startindex' is not a valid number the `atoi' method will rise an exception like: Error Type: ValueError Eror value: invalid literal for atoi(): So is better to check first, something like: Error message - INVALID NUMBER Other way is to force `startindex' to be a int like: ... But you could have problems, an exception like above could occur (if someone will input an invalid number) and you can not do something. That's the story. PM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] range with variables
Hi all, I've a problem using the following dtml construct: # <-- that's the problem!! do something How can I set the variable "start" from a user given input? Thanks! armin -- Armin Wappenschmidt - Consultant Engineer SDRC Ford Program OfficeSDRC Software und Service GmbH Spessartstrasse (D-MD/PA-2) Martin-Behaim-Strasse 12 D-50725 Koeln-Merkenich D-63263 Neu-Isenburg Phone (+49) 0221-90 33619 Phone (+49) 06102-747-0 Fax(+49) 0221-90 31243 Fax (+49) 06102-747 299 PROFS AWAPPENS mailto:[EMAIL PROTECTED] _/_/_/_/ _/_/_/ _/_/_/ _/_/_/_/ _/ _/_/ _/_/_/ _/_/_/_/ _/ _/ _/_/_/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/_/_/_/ _/ _/ _/_/_/_/ S O F T W A R E U N D S E R V I C E G M B H ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )