Trying a custom handler for several math fields

Vaughn Clement vclement at gmail.com
Fri Sep 13 09:48:21 EDT 2013


To All

OK I have complained about documentation and I should not raise an issue
without also offering a solution. I developed a database for the Cloud
Server that is called My Codebook Pro v12. This app goes beyond a forum or
an email help system. I already added the user guide chapters in one record
with each chapter in a sub code element under the main record. This app
also includes a way to add this app to any iPhone or iPad or use it in any
browser on any device.

This would offer a way to take the great community help you all provide and
give a place to retain the code samples like to ones in this email help
request. A simple copy and paste and fill in a few fields to assist any
user to find this data in a search. Instead of loosing the help data in
these emails, you can make them available to all LiveCode users. It will
also support images for each tech note that using the iPad or iPhone can be
pasted into the tech note. All of this would be searchable by a set of
subject field used in a search. It find the specific records you want to
see. If this is something you might use let me know and I will make it
available for free to everyone. You will also be able to use this for
telling people about any product you offer that may help developers.

I will soon publish a help email telling you where you can find this app
and how to use it.


Thank you

Vaughn Clement

Apps by Vaughn Clement (Support)
*http://www.appsbyvaughnclement.com/tools/home-page/*
Skype: vaughn.clement
https://secure.join.me/appsbyvclement
FaceTime: vclement at gmail.com
LogMeIn also avaialble
Call on "ooVoo" at address:  vaughnclement or 9282549062
Ph. 928-254-9062
Cloud Hosting Registration Web Site:
https://my.oditech.com/cart.php?a=add&pid=41


On Thu, Sep 12, 2013 at 10:53 PM, stephen barncard <
stephenREVOLUTION2 at barncard.com> wrote:

> On Thu, Sep 12, 2013 at 9:51 PM, Vaughn Clement <vclement at gmail.com>
> wrote:
>
> > The current database I use is FileMaker Advanced and it is so well
>
>
> yes but Filemaker can be limiting as it is so easy to use the pre-fab
> scripting segments...with built in bumpers...
>
> LC is the wide open spaces of "do anything".
>
>
> Barncard's Baby Steps example
>
>
> you just need to 'clean' the strings before doing math
>
>
> pseudo code can help create visualize actual running code
>
> put the data from the field into a variable
> if character 1 of the variable is "$" then  delete character 1 of the
> variable
> if commas are in the variable replace  comma with empty
> use the cleaned variables to do the math
> replace the $ and the comma
>
> real code : put this into a button:
>
>
> *on* mouseUp
>
>    -- this is a comment -- two dashes, also could be used to 'turn off' a
> line for tracing
>
>    *local* tVar1,tVar2,tVar3
>
>    *put* "$34,000" into tVar1  -- it could just as easily be --  *put*
> field
> "A" into tVar1
>
>    *put* "$120,000" into tVar2 -- it could just as easily be  --  put field
> "B" into tVar2
>
>    *if* char 1 of tVar1 is "$" *then* *delete* char 1 of tVar1
>
>    *if* char 1 of tVar2 is "$" *then* *delete* char 1 of tVar2
>
>    *replace* comma with empty in tVar1
>
>    *replace* comma with empty in tVar2     *-- comma is actually a system
> constant*
>
>    *put* (tVar1 + tVar2) into tVar3   *-- (the math)*
>
>    *put* "$" before tVar3 -- restore the dollar sign
>
>    *put* comma before char -3 of tVar3  -- replace the comma
>
>
>
>    *put* tVar3 *-- into message box*
>
> *end* mouseUp
>
>
>
> the message box will show   $154,000
>
>
> obviously some exception code needs to be written to handle a variable
> number of zeros, this is an ultra simple example to get you started.
>
>
> READ THE CHAPTERS and examples ON CHUNK EXPRESSIONS.
>
> ---------------------
>
>
> the message box is your friend. It allows you to test out single line
> expressions before you drop them into a script, or to test short scripts.
>
>
> I don't think you are ready for the debugger yet...
>
> Try working little bits at a time until you get the hang of the syntax.
> Don't try to do too much at first. Do Little baby steps, then put the
> pieces together.
>
> Defining variables is not necessary but is good programming practice
> anyway, and is a more comfortable style for programmers coming from other
> disciplines.
>
> You WILL struggle. and have to look a lot of things up and ask questions.
> You will get frustrated. But after a while you will get it and I promise
> you will be here helping others in a few months..... mark my words... this
> is the friendliest, funniest and most helpful set of folks on this list you
> will ever find for a programming language and you find us very helpful -
> we've all been where you are right now at some point, even Hypercard pros
> have trouble at first.
>
> We will all help you to some extent, but ultimately you have to write the
> code that does what you want. FUTZ around. experiment.
>
> If you get hung up, work on another aspect.  Read the dictionary, and
> examples, even if they don't apply to your particular application. You will
> get ideas, try them out.
>
> Don't expect to write an app in a day yet. Take your time. And the
> documentation and examples are fine especially for what you are trying to
> do now, it's just that the vocabulary is 10x the size and more versatile.
> --
>
>
>
> Stephen Barncard
> San Francisco Ca. USA
>
> more about sqb  <http://www.google.com/profiles/sbarncar>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list