Chat with Me -- HOST - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: Chatting and Socializing (https://staging.qb64phoenix.com/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://staging.qb64phoenix.com/forumdisplay.php?fid=2) +--- Thread: Chat with Me -- HOST (/showthread.php?tid=1262) |
RE: Chat with Me -- HOST - Kernelpanic - 12-16-2022 Thank you for the hints. I think I now know why you just have to specify the path to an external program. Now I tried to write a function that one enter the respective external program. But I get an error message that I can't do anything with. I searched the internet but could not find anything that explained the error message. - Even the error message I can't fully understand. "Illegal string-number conversion" . . . where is there a string-number? Due to this error message I was unfortunately not able to check whether this function would work at all. Code: (Select All) 'Externes Programm aufrufen mit Funktion - 15. Dez. 2022 It is: externesProgramm = pfad RE: Chat with Me -- HOST - Kernelpanic - 12-16-2022 (12-15-2022, 02:39 PM)Spriggsy Wrote: I'm so confused. How does Notepad++ play a role in the chat program? The Notepad++ problem starts here: https://staging.qb64phoenix.com/showthread.php?tid=1262&pid=11386#pid11386 RE: Chat with Me -- HOST - Pete - 12-16-2022 (12-16-2022, 12:53 AM)Kernelpanic Wrote: Thank you for the hints. I think I now know why you just have to specify the path to an external program. Code: (Select All) 'Externes Programm aufrufen mit Funktion - 15. Dez. 2022 Pete RE: Chat with Me -- HOST - Kernelpanic - 12-16-2022 Thanks, Pete! I would not have thought of the "$" next to the function. The program works now. One more note, without "Console" one can not enter "\". Code: (Select All) 'Externes Programm aufrufen mit Funktion - 15. Dez. 2022 RE: Chat with Me -- HOST - Kernelpanic - 12-16-2022 I have now expanded the program so that you can specify the location of the program. I have programs under both "Programme" and "Program Files". -- By the way, I myself have never created a "Program Files" directory, the installation routines always specify that. I created the "Programme" folder because, for example, Strawberry Perl does not like "Program Files". Code: (Select All) 'Externes Programm aufrufen mit Funktion - 15. Dez. 2022 Example: RE: Chat with Me -- HOST - mnrvovrfc - 12-16-2022 (12-16-2022, 04:56 PM)Kernelpanic Wrote: Thanks, Pete! I would not have thought of the "$" next to the function. Maybe you and I should campaign so the "AS TYPE" clause could be put at the end of a function header. Do you use Freebasic or Visual Basic? You have to try to remember QB64(PE) still requires the type sigils, whatever they are, right after a function's name in the header, and nothing except "STATIC" right after the closing parenthesis of the parameter list. It should have been easy to remember that any string function in QB64(PE) must carry the dollar sign at the end of the name! Like "MID$", "STR$", "SPACE$" and so on. Instead of: function addtwo (one as long, two as long) as long you must write it: function addtwo& (one as long, two as long) You write code in the other BASIC, and then you should load it into the QB64 IDE, which should flag the errors of "AS TYPE". Then you should know which sigil for which type. https://qb64phoenix.com/qb64wiki/index.php/Variable_Types EDIT: Why isn't the "DECLARE" line flagged as an error? Maybe it's what allows the user's function to be used without the dollar sign. (facepalm) RE: Chat with Me -- HOST - Kernelpanic - 12-17-2022 I can not comprehend why a type declaration has to be attached to the function name here: Code: (Select All) Declare Function externesProgramm(extern As String) As String . . . but not here: Code: (Select All) Option _Explicit RE: Chat with Me -- HOST - Pete - 12-17-2022 Actually, DECLARE SUB and DECLARE FUNCTION statements are not needed in any QB64 statements. That's an old QBasic holdover. You can REM them all out and your code examples should run just fine. Pete RE: Chat with Me -- HOST - Kernelpanic - 12-17-2022 (12-17-2022, 06:13 PM)Pete Wrote: Actually, DECLARE SUB and DECLARE FUNCTION statements are not needed in any QB64 statements. That's an old QBasic holdover. Yes, I have noticed that by now. I personally think that is wrong, because the declaration of functions and procedures at the beginning of the source code shows what is coming. Ok, but I still do not understand why one function needs a type identifier and the other does not. RE: Chat with Me -- HOST - Kernelpanic - 12-17-2022 I think I know the reason now - the extra type declaration is only necessary for strings. (Enter -Hello-, I will complete the sentence) Code: (Select All) Option _Explicit |