English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. System (https://eab.abime.net/forumdisplay.php?f=113)
-   -   using "/" char in con: window title (https://eab.abime.net/showthread.php?t=93899)

meynaf 23 August 2018 17:51

using "/" char in con: window title
 
Yo!, another problem happening to me with our (otherwise fine) operating system.

This works fine :
con:0/0/640/100/window title/wait/close

But this, of course, does not, because of extra slash :
con:0/0/640/100/this is a/b window/wait/close

No escape char for this available ?
Using "" just adds the quotes themselves to the title.
Same for *, %, or everything i tried.

If it can't work (as of v39) then what's the exact list of invalid characters here ?

Leffmann 23 August 2018 19:01

AFAIK the only way is to find the window and call SetWindowTitles() to change it, and then you can put slashes in the title, and probably all other printable characters.

kolla 26 August 2018 08:05

I don't want to be Captain Obvious here, but...

con:0/0/640/100/this is a\/b window/wait/close

EDIT: Captain Obvious can report that the above works with ViNCEd CON, but not original CON :)

meynaf 26 August 2018 09:12

Quote:

Originally Posted by kolla (Post 1264246)
EDIT: Captain Obvious can report that the above works with ViNCEd CON, but not original CON :)

Sorry, it's all about original CON: as it needs to work on just every V37+ machine.

Leffmann 26 August 2018 12:31

Why does it have to be a forward slash? Cosmetic reasons?

meynaf 26 August 2018 14:08

Quote:

Originally Posted by Leffmann (Post 1264308)
Why does it have to be a forward slash? Cosmetic reasons?

Absolutely not. Input string could be just about anything as it's for included reusable code, and i don't like to have forbidden characters.

Leffmann 26 August 2018 16:09

Try this:
Code:

BPTR con = Console("con:0/0/400/100", "a close/wait window", "close/wait");


BPTR Console(char* size, char* title, char* flags) {
  char temp[200];
  BPTR con;

  strcpy(temp, size);
  strcat(temp, "/xyz123/");
  strcat(temp, flags);

  con = Open(temp, MODE_NEWFILE);

  if (con) {
    ULONG lock;
    struct Screen* scr;
    struct Window* win;

    lock = LockIBase(0);

    for (scr = IntuitionBase->FirstScreen; scr; scr = scr->NextScreen)
      for (win = scr->FirstWindow; win; win = win->NextWindow)
        if (strcmp("xyz123", win->Title) == 0)
          SetWindowTitles(win, title, -1);

    UnlockIBase(lock);
  }

  return con;
}



All times are GMT +2. The time now is 09:32.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04322 seconds with 11 queries