Can it do what I want?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
vascoribeiro
Posts: 33
Joined: Tue Apr 25, 2017 8:13 pm

Can it do what I want?

Post by vascoribeiro » Tue Apr 25, 2017 8:27 pm

Hi there, this is my first post!
I'm a beginner in this programming stuff, so....... Have patience with me! =D

I have already done a really simple app with live code, basically a specific calculator for my work. The details may be a little boring, so what I want to know is:
is it possible to make an app that the user can interact making methods?

For example, user A define the fixed values he wants in this method and say that the method name is "test".
Then, user B define other values (that are intended to be in blank in the "test"), so he can calculate what he wants.

Additionally, is it possible to define different user profiles to this kind of software? For example, imagine that user A is an Administrator and user B is simply an User (can not make or edit methods, only calculations).

Hope I'm making myself understand in my questions...
Thanks for the help!!!

Vasco

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9664
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Can it do what I want?

Post by dunbarx » Wed Apr 26, 2017 3:06 am

Hi.

Welcome to LC.

Yes. But we need a little more information about your "methods" and your intentions.

It is certainly possible to limit certain actions to specific users, perhaps by requiring some sort of password or other special "key", which will enable only certain objects and actions. So user "A" might have control over all aspects of the application, whereas user "B" might find that certain controls are either limited in scope, hidden or disabled.

As just another example, it is possible to limit or filter the values that can be entered into a field. Say user "A" can enter any text at all, but user "B" can only enter numbers. Or user "A" can enter any number, but user "B" cannot go higher than 100. That sort of thing. There are many ways to work this, and it sounds like a lot of fun.

But is this is what you are talking about?

Craig Newman

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Can it do what I want?

Post by MaxV » Wed Apr 26, 2017 2:48 pm

Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

vascoribeiro
Posts: 33
Joined: Tue Apr 25, 2017 8:13 pm

Re: Can it do what I want?

Post by vascoribeiro » Wed Apr 26, 2017 6:29 pm

@dunbarx
Thank you for your answer!

I'll try to explain this "methods".

I work as a chemist and this methods are specific analysis methods. This analysis require the use of solvents more or less complex. The simplest method would be the use of a solvent A at 1,5 ml/min for 15 minutes. In this case, say we are analysing 4 samples: we will expend 1,5*15*4 = 90 ml of solvent A.

There are more complex methods: at 1,5ml/min 15 minutes but in this case we start with 100% solvent A. Than from the minute 5 to 10 we exchange for 50-50 with solvent B, and for the last 5 minutes we return to 100% solvent A. This involves gradients in witch at every step we have a different percentage of solvent until we get to 100% or the 50-50. This can be more complex since, in my work, we can develop methods with 4 solvents, different times and different flows.

So, as a chemical analyst I have a little problem... How much solvent A, B, C and D do I really need? Most of the times what happen is that I do it in excess, and then we have a waste of resources. If I do less solvent than needed I will probably lose my current work, since little changes in the solvents will affect some parameters of the analysis (some solvents also have 3 or 4 components in different proportions).

With an app I could fill a table of gradients, flow, and run time and define different methods (it depends of what product I'm analysing) - this as an admin.
As a user I would only need to insert the number of samples and I could retrieve information like: time of work and exact volume of each solvent. With this I could reduce waste and time in my work.

What do you think? ;)

Is there any recommended tutorials that meet my needs? Thanks!

@MaxV
Thank you, will do it!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9664
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Can it do what I want?

Post by dunbarx » Wed Apr 26, 2017 6:53 pm

The creation of privileges for "admin" and "user" are simple. It is the creation of a solvent flow rate and volume application that will take the time.

This will have to be worked out by you. It is what LC is exactly designed for, a custom tool that you create for your own needs; there is no better. The good news is that only relatively basic LiveCode functionality is required to make this tool, and I bet that only thirty or so native words (commands, functions and properties) will be required. So you do not face a very great learning curve, beyond the amount of effort you, or anyone, needs to expend in order to really get going in the first place. That initial effort is not trivial. But your particular task is actually very limited in scope, and any experienced helper here could write most of it in a few hours, provided they were very familiar with all the parameters you spoke of. But only you really know those parameters. Ask here for advice on LC issues anytime and often.

You may be interested to know that I have, mounted on my living room wall, a wooden periodic table of the chemical elements, with physical samples (in appropriate containers as required) sitting in front of their symbols. I have 88 elements, which I believe is the most complete in the world.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can it do what I want?

Post by FourthWorld » Wed Apr 26, 2017 7:16 pm

Hello vascoribeiro -

This may be a good fit for LiveCode's "do" command or "value" function. The former executes any string containing a valid LC statement, and the latter evaluates a string containing any valid LC expression and returns the result of that evaluation.

The try/catch control structure will let you handle errors from invalid expressions gracefully.

The multi-user aspect is a deeper problem, where the solution will depend on many things about how the app works and how it's shared. Let's handle that after you're first comfortable with running expressions through the "value" function so you can have confidence the core of what you need to do will work well.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Can it do what I want?

Post by capellan » Wed Apr 26, 2017 8:52 pm

This requirement brings to my memory the original HyperCard's User Levels:
Browsing, Typing, Painting, Authoring and Scripting.

If the User only could execute functions, while the Administrator could add,
modify or delete these functions then, What happens if an User want to try
a new variation of a formula or a new function? Would this program allows this?

Using a simple text file (compressed and encrypted) this program could load the
original functions while starting and then, allow the User to experiment and save
their own methods, formulas or functions. It's not as complicated as it sounds,
it's just reading and writing files, one of the most basic features of this platform.

Vascoribeiro, I could help you a little bit with the interface of your program.
Keep us updated about your progress and obstacles that you find while
creating your program.

Al

vascoribeiro
Posts: 33
Joined: Tue Apr 25, 2017 8:13 pm

Re: Can it do what I want?

Post by vascoribeiro » Sat Apr 29, 2017 12:52 am

Hello everyone!
Thank you so much for all the information you gave me. I have to review all this information and will get started soon with this project. I have now 15 days off work so... I think that sooner or later one of this days I'll come here crying for help. :lol:
dunbarx wrote: You may be interested to know that I have, mounted on my living room wall, a wooden periodic table of the chemical elements, with physical samples (in appropriate containers as required) sitting in front of their symbols. I have 88 elements, which I believe is the most complete in the world.

Craig
Thats quite amazing Craig! It is probably one of the most complete... At the same time it kept me thinking - "that can be dangerous" XD. Not that dangerous though because the most reactive ones may be only residual. Unfortunately I only have a little one in my study.

Thank you all again, I'll come back here soon!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9664
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Can it do what I want?

Post by dunbarx » Sat Apr 29, 2017 10:10 pm

because the most reactive ones may be only residual
By most reactive do you mean Fluorine or Cesium? Polonium or Technetium?

I have what you might call residual Po, a milligram plated onto Gold foil. But all the other "reactive" ones I have in quite weighable quantities, Fluorine excepted, in sealed glass ampules under argon.

Feel free to contact me off-forum.

Craig

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Can it do what I want?

Post by capellan » Sat Apr 29, 2017 10:59 pm

Amazing collection, Craig! 8)

Have you posted online a high resolution photo of your display?

Al

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Can it do what I want?

Post by TerryL » Thu May 18, 2017 6:19 pm

Hi Vascoribeiro. LC would make a fun project, but don't underestimate the lowly spreadsheet. I put this together in under an hour. Maybe it will help. Terry
SolventCalc.jpg
SolventCalc.jpg (25.11 KiB) Viewed 6850 times
Attachments
SolventCalc.zip
(15.86 KiB) Downloaded 194 times
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html

vascoribeiro
Posts: 33
Joined: Tue Apr 25, 2017 8:13 pm

Re: Can it do what I want?

Post by vascoribeiro » Thu May 18, 2017 7:04 pm

Hi everyone!

TerryL, I don't underestimate the spreadsheet at all! :D
Of course, if I'm creating a software to make calculations the spreadsheet should be capable of doing so. The thing is, I'm having some fun, and adding capabilities to this tool that spreadsheets can't...
I've made one in the first place, before starting using livecode.(I attached here mine
Calculadora de Fase móvel para HPLC - gradientes.zip
App
(39.09 KiB) Downloaded 176 times
... It's in Portuguese but easy to understand)

And... I've done the software, but I'm still improving it. I'm a little embarrassed to show it because almost everyone here is more experienced. The code may make some of you laugh, so... Consider it kind of a 9gag of programming XD

The app is called LeanLab, is in my website, theBiochemist351 from google sites, if you want to take a look...

Many things to improve and add to the App. Suggestions?

Thank you everyone

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”