Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CHAIN
#1
Hi,
I am having a problem using QB64-CHAIN on an Windows XP-x86-system. 
From QB 4.5 , Original, Sources. I am copying and using COM1_EX.bas and COM2_EX.bas.
The CHAIN command in COM1_EX is supposed to copy via COMMON a 1-dim-array()  into COM2_EX - where however it's array-contents never arrive.
I did create COM2_EX.exe to be chained.
I also tried it with COMMON SHARED , and by using the identical variable names in both programs - no effect.
While using QB 4.5 the two programs chainig work ok.
Any ideas what may create that behavior? 
Udix
Reply
#2
It seems like you did everything right. Working on a Windows system, used COMMON SHARED, and created both files.

I never used CHAIN. Back in the day. I'd create a database to pass the variables and used RUN.

You may get an answer or some dialog with another member or dev. If not or there is no fix, the easiest way to get your program working again would be to make it just one program. Paste the entire second program into a newly named sub in the first program, and just delete any duplicate definitions.

Welcome to the forums,

Pete
Reply
#3
Didn't @TerryRitchie also bring up this same issue in attempts to help someone update some old code?

It's no longer needed these days with nearly unlimited program size but yes QB64 does like to pride itself on preserving compatibility with old code, until v2 broke past functions working smoothly.

Combine the sources? or try Run?
b = b + ...
Reply
#4
Without source code nobody can tell what could go wrong. Maybe this will help - runs under Win 10: Chain command not working
Reply
#5
Ah there's the link to Terry's thread!
b = b + ...
Reply
#6
Yes, I remember that discussion. It was determined that it would be best to update the code or use variables and RUN as Pete described.

Would you be willing to post the source code for all the modules? Perhaps someone could guide you on how to best approach the issue.
Reply
#7
The point is that CHAIN in QB64 is emulated passing value using a file..

So you can decide
1. to do it by yourself (using a temporary file to pass value between 2 programs)

2.or code correctly and QB64 does it for you...but there is no direct access to RAM, only data stored in a file and read from the second program

3. you can use in Windows 10 and Linux SO the solution posted by Sprigssy

For a more specific counselling you must share code
Reply
#8
Welcome to the forums @Udix .

What version of QB64 are you using? I'm asking because you wrote you are using 32-bit, is that correct? If so then you're better off still using QuickBASIC because WindowsXP could still run that; the same cannot be said for eg. Windows10. If you don't need specifically a feature from QB64 such as "_INTEGER64" then you should still use the older 16-bit software for what you want.

Supporting "CHAIN" and "COMMON SHARED", and otherwise "BRUN45" library behavior wasn't a high priority for the creator of QB64. Avoid using "CHAIN" in QB64. In fact, try hard not to have separate programs that have to communicate with each other for any reason because they could present a security issue especially if you have to use them while online.
Reply




Users browsing this thread: 2 Guest(s)