# Thread: Form change when copying from one computer to a second computer

1. ## Form change when copying from one computer to a second computer

I designed a form for my application which fitted the full screen of my Toshiba Laptop, and which when checked was 36.38 cm wide and 16.51 cm high - according to the properties panel. The Toshiba laptop has a 15.5 inch diagonal screen.

However when this same database and form was installed with a second allowable copy of A5 on my desktop computer, suddenly approx 25% of the RH side is not viewable and off screen to the right. Why is this?? FYI the desktop screen is a standard and new 19.5 inch diagonal ACER proper computer monitor (not a TV screen).

And changing the width and height properties of the form does not fix the problem, or "shrink in" the full desired form into a lesser width space.

So the problem I now forsee is that when I want to transfer/update the data files between the two computers – and I will want to be doing that BOTH ways between the two computers via the A5 Backup/Restore function and via a USB stick - if I change/resize/redesign the form on one computer, then that form change will go with the respective copied database and data, but be wrong in terms of form view and size when viewed and copied onto the second computer.

That is, if I leave the form “as is” on the laptop and copy to the desktop, then the form will be too wide on the desktop. Conversely, if I shrink the form to fit on the desktop and copy to the laptop, then the form will be too narrow on the laptop.

Given this problem seems peculiar to A5 when viewed on the desktop, (that is there is no problem with any other program I have on the desktop such as MS Word, Explorer/Internet etc etc, and they all view the same on both computers), then as far as I can see the problem is within A5, and not either computer as such.

Can anybody suggest a solution???

Many thanks

2. ## Re: Form change when copying from one computer to a second computer

Alpha desktop has always had a limitation in that it does not resize.

Question about your monitor settings for the new monitor? there is a width setting on your monitor is it properly set to the edges of the screen? I have seen this be an issue before.

3. ## Re: Form change when copying from one computer to a second computer

Hi Dave,

Thanks you for your reply. Yes monitor width stings ok. The form is missing about 3-4 cm on the RHS - quite a lot to readjust for. So are you saying there's nothing I can do about this, as it is a limit or "bug" within A5 ??

4. ## Re: Form change when copying from one computer to a second computer

It is not a bug, just call it a mild restriction

There are some ways around it, but difficult.

For instance:
I build my apps on a huge monitor and quickly open them from 2 other computers(laptop and a desktop) with what would be current standards for most users. That determines the size of my forms.

Another way is to build a form to match several different resolutions and monitors like a user may have. Then you can select which forms(s) to use at the beginning. Some have even detected the resolution on app start and then chosen the form(s) for the user from that. It can be done, but you wind up with 3-4 of the same forms in different sizes. That can be a headache to keep up with if you do many changes to the apps.

Current app is set to be useable on my laptop at 1280 X 768. It is a brand new unit, but that is the upper limit of the settings. On my work machine at 1920 X 1080, the form takes up a smaller amount of space. For this app that is going to a place where some of the users are still trying to keep 800 X 600, they will just have to adjust their settings to be able to see it all. I am not getting paid enough to design a bunch of extra forms. They need to move on up in the world. I am designing to fit their (mostly) 19" diagonal monitors and then dropped smaller due to some having laptops. ( I know they are in process of upgrading all their 40 computers).

5. ## Re: Form change when copying from one computer to a second computer

Thanks Dave, very helpful. Nice of Alpha though to make this so difficult.

As I'll only ever be using the two computers, I'll have a go at your solution of having two forms - one for each computer - then select on start-up as required. Like you say though, it is a pain.

Many thanks

6. ## Re: Form change when copying from one computer to a second computer

You could design forms for the smaller screen that are not maximized, ie windowed, and use the anchors to move objects right or left, up or down, when the form is resized by the user.

7. ## Re: Form change when copying from one computer to a second computer

It can entail some coding in the autoexec to make it automatic, or just choose from a main menu for.

You might have a thought of changing the resolution of the screens instead??

Just thoughts.

8. ## Re: Form change when copying from one computer to a second computer

Originally Posted by DaveM
You might have a thought of changing the resolution of the screens instead??
.
Exactly!
When developing for clients give the advantage for those with high res screens that they can use the extra space for other things. Make some of your elements (like browses, control buttons, diagrams, status screens) modeless, the user benefits enormously.
Many power users work across 2 screens anyway.

Thanks Robin

10. ## Re: Form change when copying from one computer to a second computer

Thanks again David. I have now two copies of the same form, except one wide, one narrower, and for now will select manually as needed. Prefer to not change resolution.

But redoing the autoexec to automatically sense & choose was going to be my next thought, but could be fun. Any thoughts on the coding required ???

Thanks Ray

12. ## Re: Form change when copying from one computer to a second computer

I never did it, but there have been a couple of posts in the forum with at least a bit of help on the coding needed.

13. ## Re: Form change when copying from one computer to a second computer

I think you'll find what you are looking for here:

http://www.learnalpha.com/AlphaTips/...creenSizes.htm

I used this approach on an application several years ago and it worked well.

Thanks again David. I have now two copies of the same form, except one wide, one narrower, and for now will select manually as needed. Prefer to not change resolution.

But redoing the autoexec to automatically sense & choose was going to be my next thought, but could be fun. Any thoughts on the coding required ???

14. ## Re: Form change when copying from one computer to a second computer

Thanks Tim,
I had seen that earlier and was looking for it.

15. ## Re: Form change when copying from one computer to a second computer

Thanks you Tim and Dave --- and Jack Wheeler of it works!!

I'm not great with scripting coding etc, but will give it a good go.

Many thanks for your generous help. I'll let you know how it goes in a week or so.

16. ## Re: Form change when copying from one computer to a second computer

Dear Dave and others,

With all the changes required when getting reactivated on the second machine, it brings to mind that the Alpha activation process uses the "Computer Name" to track one's licence usage and distribution.

So it got me to thinking - and given I'm only working between two computers and associated monitors - could one use the system's "Computer Name" together with the "if" function in some way in the autoexec, to say (using simple English for now) something like:

" if Computer Name = ABC, use FormABC, otherwise FormXYZ. "

That is if it boots up on Computer ABC, FormABC comes up, and which is the right form for that computer. But if it boots up on the second computer (regardless of computer name even) the second form comes up.

Obviously Jacks script would seem to work for more or multiple monitors or systems, but with only a two computer/monitor setup, maybe the above " if " function idea might work - or am I missing a lot ????

Many thanks

Arthur Cooke

17. ## Re: Form change when copying from one computer to a second computer

" if Computer Name = ABC, use FormABC, otherwise FormXYZ. "
Yes

and consider http://wiki.alphasoftware.com/~alpha...+with+the+Form

18. ## Re: Form change when copying from one computer to a second computer

Thank you Alan

19. ## Re: Form change when copying from one computer to a second computer

One other idea ????

At the moment, and when using one computer [C1] only I start-up A5 and my application with desired database, from the desktop icon:

Icon/propertices/Target: "C:\Program Files\A5 ver11\alpha5.exe" "C:\My Documents\COASTWIDE\Alpha 5v11 Dev Data\Coastwide Small\Coastwide - small.adb"
and
Icon/Properties/Start in: "C:\My Documents\COASTWIDE\Alpha 5v11 Dev Data\Coastwide Small\"

When using one computer [C1] only, starts fine and I have the desired start up form [F1] specified within A5 Properties. I also have the second shrunk form [F2] within that database to suit the second computer [C2]. Then when backing up C1 and restoring/transferring all my data to second computer [C2], and obviously both forms go across. But with the extra computer now, I have to manually select the shrunk form F2 - which also work fine. But if I set A5 properties on C2 to start up with the second form F2, the when backing up and restoring on C1 with later data, naturally the start up form will then be F2 on C1 - not desired, but could of course easily reselect the matching form F1. Not a big drama, and it would work, but messy.

So was wondering if one could use a Form specifier in the Icon Properties 'Target' or 'Start In', along with the database specifier, that starts up the database and the desired form - F1 or F2 - according to the matching "Machine Name" handle ??? This would stay with but differ with each machine, but not be included in the backup/restore process. That way one would not have to reselect forms, but it would start up with the correct matching form for each computer - ie F1 with C1, and F2 with C2.

I have tried to do this, but can't figure out the correct code or system parameters as yet to do it. Seems like I might be trying to incorrectly mix computer system file info and data, with A5 file info and data???

Any ideas which might help

Many thanks

Arthur Cooke

20. ## Re: Form change when copying from one computer to a second computer

in autoexec script at the end substitute your own form names.

Code:
dim machname as c
machname = API_GETMACHINENAME()
if machname = dave1 then
form.view("dotimes")
else
form.view("Budget")
end if

21. ## Re: Form change when copying from one computer to a second computer

That was quick - thank you Dave
Arthur

22. ## Re: Form change when copying from one computer to a second computer

Hope it works well for you. It is very simple one.

23. ## Re: Form change when copying from one computer to a second computer

Hi again Dave.

Well that I’m sure would normally work, but when I created the autoexec script below, it produced a really weird one.

When putting either of these into the script:

dim machine as c
machname = api_getmachinename()
form.view("CWSmall Clnt Simple set")
else
form.view("CWSmall set for eMachine")
end if

then it produces an error message saying:

“There was an error running the Autoexec script.

It seems it does not like having a hyphen before ADC in EMACHINE-ADC, or before the PC in ADC-TOSHIBA-PC.

However it doesn’t seem bothered by the hyphen AFTER the ADC in ADC-TOSHIBA-PC.

Now whilst this could be easily fixed by re-naming the computers with no hyphens on the one hand, it would I think create a major problem in getting Alpha Software to change the computer names associated with the licensing, so I’d rather not try go there.

So I guess I could go back to Jack White’s scripting for “selecting screen size”, but I would much prefer to stay with the above as it is so simple and convenient.

Any suggestions ?????

24. ## Re: Form change when copying from one computer to a second computer

ADC-TOSHIBA-PC needs to be in quotes

25. ## Re: Form change when copying from one computer to a second computer

Thanks you Tim.

I had tried that before my last post, but for some reason still did not work, but now does as the error message does not come up anymoew. However it now just goes straight to the control panel after opening - ie it does not automatically open up the form, as it did when startup form was specified in Settings.

I've still got the desired database to be opened specified in the Icon properties. Should that be changed to be in the autoexec script instead?

With thanks

Arthur

26. ## Re: Form change when copying from one computer to a second computer

You may want to run api_getmachinename() from the interactive window to confirm that what the function returns is what you are expecting. Another issue to check is run the form(view) command from the interactive to see if the form opens. I see that you have spaces within your form names which is recommened against. In many instances alpha will replace the spaces with an underscore which results in the name the function ultimately uses not matching what you have named the form.

27. ## Re: Form change when copying from one computer to a second computer

Thanks Tim, I'll try all that. No trouble to change the Form names.

Arthur

28. ## Re: Form change when copying from one computer to a second computer

Hi Tim,

Running both form.view commands in the interactive window opened the correct forms.

But running the API_GETMACHINENAME() in the interactive window produced absolutely nothing, either with or without the " dim machname as c ' in front of it or not ! Very surprising, given it was looking so elegant and simple.

So where to from here??

Many thanks
Arthur

29. ## Re: Form change when copying from one computer to a second computer

Further note: As you can gather, I'm not much on XBasic, but I notice ' machname ' does not come up in any Alpha Help Files search of recognised variable names; should one be using straight out ' machinename ' instead of ' machname ' ??? Definitely no disrespect to Dave !!!

OR.....

is ' API_GETMACHINENAME() ' not working because I'm expecting MACHINE NAME to be the same as COMPUTER NAME, which may not be valid. I'm specifying COMPUER NAMEs in the autoexec. It doesn't show or specify MACHINE NAME in the Windows System Properties window, only COMPUTER NAME.

I say this because such details often need to be very exact in computer programing terms.

Arthur

30. ## Re: Form change when copying from one computer to a second computer

I just ran this on a production adb to test it again.

In the interactive window:

dim machname as c
machname = API_GETMACHINENAME()

select the above and run it.
Then type the below and press enter

?machname
= "DAVE1"

should give you the computer name.
It does this on all my win7 and win8 machines.

Code:
dim machname as c
machname = API_GETMACHINENAME()
if machname = "dave1" then
form.view("dotimes")
else
form.view("Budget")
end if
machname is just a variable, you won't find it in the help files.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•