Some Foolish questions

Fred Giannetto fgiannet at hotmail.com
Tue Oct 4 16:10:07 EDT 2005


Hello Everyone,

1) Absolute value question.  Here is a copy of the script.
I want input values over 10 to create a deficit in the Consumer and Foreign 
fields.  Example, a user puts 15 into the Reserves field.  It is subtracted 
from 20 putting the remainder into tReserves.  tReserves is less then 10 so 
it has 10 subtracted from it, it is divided by 2 resulting in -2.5 into 
tConsumer but I only see 2.5.  The script is a little convoluted because I 
have been trying to solve this problem.

on mouseUp
  put 20 - field "Reserves" into tReserves
  switch
  case tReserves < 10
    put tReserves - 10 into tShortfall
    put tShortfall / 2 into tConsumer
    put -tConsumer into field "Consumer"
    put tShortfall / 2 into tForeign
    put -tForeign into field "Foreign"
    put field "Reserves" into field "Military"
  case tReserves >= 10
     put tReserves / 2 into field "Consumer"
     put tReserves / 2 into field "Foreign"
     put field "Reserves" into field "Military"
     end switch
end mouseUp

2.  I am using the database property "move to previous record" for the 
previous record button and it is setup to access the correct query.  I have 
created two queries using Microsoft Access driver and Microsoft do Access 
driver.  I have attempted to connect with both of them and they exhibit the 
same symptoms.  I can only go forward and refresh.  The MySQL connection 
works without any problems.

If there are no foolish questions then I am sure I will at least breach the 
perimeter of the inane.

Thank you for your assistance
All best Always
Fred



>From: Ken Ray <kray at sonsothunder.com>
>Reply-To: How to use Revolution <use-revolution at lists.runrev.com>
>To: Use Revolution List <use-revolution at lists.runrev.com>
>Subject: Re: Some Foolish questions
>Date: Thu, 29 Sep 2005 20:47:03 -0500
>
>On 9/29/05 7:12 PM, "Fred Giannetto" <fgiannet at hotmail.com> wrote:
>
> > Hello everyone,
> >
> > I am evaluating the software and have a couple of foolish questions.
>
>Welcome, Fred! No questions are foolish!
>
> > 1) It seems the fields are only returning absolute value.  The script is
> > performing the math correctly but the field returns all negative values 
>as
> > absolute values.  Is there a setting or a way around this?
>
>Well, without knowing what the script is that is executing, it would be 
>hard
>to give you an answer. Can you post the script you're executing?
>
> > 2) I have connected to my Access database and results are returned.  I 
>am
> > unable to go back to previous records however.  I can only go to the 
>next
> > record or refresh the query.  Is this a limitation in a library and what 
>is
> > the way around it?  I believe I saw another post suggesting an array be
> > used.
>
>You should be able to use 'revDB_moveprev' in order to move back one record
>at a time. Rather than using a cursor (recordset), it may be more efficient
>(if there's not a ton of data) to retrieve all the data at once into a
>variable (or array) and then walk though that. If you need help in doing
>this, please let us know.
>
>Ken Ray
>Sons of Thunder Software
>Web site: http://www.sonsothunder.com/
>Email: kray at sonsothunder.com
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your 
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list