buttons links - Forum

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

buttons links

hi,

i have app to control few devices via local ethernet. right now I call each device via IP link:

InternetLink "HTTP://192.168.0.105"

so my question is, how I can create additional standalone file like some "links.txt" so i can edit if some address is changed without compiling new version of software. so in this links.txt will be multiple address like in example:

InternetLink "HTTP://192.168.0.106" //device1
InternetLink "HTTP://192.168.0.107" //device2
InternetLink "HTTP://192.168.0.108" //device3

can I make some script where button one will call first line, button two seconod line and so on?

@juricazg

This is a common forum for VisualNEOWin, VisualNEOWeb, PixelNEO and CloudNEO ... enquiries/posts specific to a product are best created in their appropriate sections.

how I can create additional standalone file like some "links.txt" so i can edit if some address is changed without compiling new version of software

can I make some script where button one will call first line, button two seconod line and so on?

Place the addresses (i.e. http://192.168.0.106 etc.) in a text file ...

- one address per line
- best to have this file in your project's [PubDir]; say it is called deviceaddresses.txt

Then, in the click event section of each button ...

SetVar "[devicenumber]" "1" ... 2, 3, 4 etc. as appropriate
FileRead "[PubDir]deviceaddresses.txt" "[devicenumber]" "[internetlinkaddress]"
InternetLink "[internetlinkaddress]"

 

juricazg has reacted to this post.
juricazg

great, many thanks Gaev!

is it possible to define with the same logic button label?

@juricazg

is it possible to define with the same logic button label?

I am not sure what you are asking ... do you want ...

1) to have just one button, and when the user clicks on it, he/she is asked to choose a number (either enter it or pick from a ListBox)

or

2) the label/caption of each button to display the "device address" related to that device

If it is (2), then ...

a) you can define the label for each button as a variable e.g. [internetlinkaddress1], [internetlinkaddress2], [internetlinkaddress3] etc.

b) in the Startup (or Page Enter) section of your pub ...

FileRead "[PubDir]deviceaddresses.txt" "1" "[internetlinkaddress1]"
FileRead "[PubDir]deviceaddresses.txt" "2" "[internetlinkaddress2]"
FileRead "[PubDir]deviceaddresses.txt" "3" "[internetlinkaddress3]"
etc.

BTW, if you go this route, then the click event code for the button would be just ...

InternetLink "[internetlinkaddress1]" ... or [internetlinkaddress2] or [internetlinkaddress3] as appropriate

 

it was option 2. it works fine.

i need that because I want to add additional custom user buttons and this solutions was what I was looking for.

thanks again...

@juricazg

Samo kratko pitanje - ti si iz Zagreba pretpostavljam ?

BOK @dglojnar

jesam.

Ha, bas fino :-)

Ako trebas plug-ins i slicne stvari, samo javi, ja koristim Neobook/VisualNeo od 1994 :-)

Najbolje na mail:

mikaari001@gmail.com

Kaj ima novoga doma?

 

Pozz:-)

 

ok.

doma, a taman bili naši kvazi izbori. jedno ludiloo manje.