Creating Button for going up or down in numbers - Forum

Forum Navigation
You need to log in to create posts and topics.

Creating Button for going up or down in numbers

Sorry for this very simple question, but I have read the help and looked at an old copy of the Neobook manual and still can not remember how it done.

I wish to have a button to go forward and backward controlling a set of Images.

i.e. image101+1=images102 or images104-1=image103.

Sorry for this simple question.

@m-burdess there is a sample app within the neoPhp folder you can adapt very easily:
https://visualneo.com/tutorials/neoPhpDb1/

Regards.

@luishp

thank you, but this need to have not database on a server, so need to be old school. Also need a way to link into a GSheet (but this may need to be removed )that hold information about the Image. The information is that of railway signals, and the routes you can go from them.

So if you signal AD101 and it can take you 6 different ways these need to be shown next to the image ( one image may have more then one signal needing to have information shown.

@m-burdess

I can't recall a tip/trick I saw on the forum for converting string variable (containing numeric characters) to a number variable ... but the following code (using javascript) works ...

SetVar "[ImageNamePrefix]" "Image"
SetVar "[currentImage]" "[ImagenamePrefix]230"



... subroutine
StrReplace "[currentImage]" "[ImageNamePrefix]" "" [ImageSuffix] ""

BeginJS
 var newSuffixNumber = parseInt($App.ImageSuffix) + 1;
 $App.ImageSuffixString = newSuffixNumber.toString();
EndJS

SetVar "[newImage]" "[ImageNamePrefix][ImageSuffixString]"
AlertBox "newImage" "[newImage]" ""

Hope this is what you were looking for.

You should be able to use similar code for subtracting suffixes; of course, you may have to enhance it to take care of suffixes ending in 000.