Results 1 to 4 of 4

Thread: Need help with context menu usage and OS_GetCommand

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    3
    Rep Power
    0

    Need help with context menu usage and OS_GetCommand

    Greetings.

    I'm having trouble with the OS_GetCommand function and I hope someone can enlighten me.

    I have a script that reads a .nxf file but I am having trouble using it from the context menu. I've associated the .nxf filetype to the script with this command:

    C:\thinBasic\thinBasic.exe "c:\thinBasic\UserScripts\nxf2scr.tbasic" %1

    and it works fine as long as the filename does not contain a hyphen. Apparently OS_GetCommand uses a hyphen as a parsing character so the full filename doesn't get passed to the program. If I add quotes around the %1, OS_GetCommand(2) returns the full filename but it looks like now I have to strip off the quotes from the string to use it for a filename in file_ commands.

    Can anyone explain how to get around the hyphen dilemma?

    Thanks much.

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Need help with context menu usage and OS_GetCommand

    Post moved to forum dedicated module.

    I'm checking code.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Need help with context menu usage and OS_GetCommand

    First, welcome in thinBasic community forum

    I've checked source code and effectively we are using the following sequence of chars to determine separators or flag chars:
    double quote (")
    space ( )
    hyphen (-)
    underscore char (_)

    I suppose this is quite restrictive and an imposition from our side.
    For this reason I'm just developing 2 new functions:
    • OS_CommandsGetSep, will let you retrieve current set of chars used by OS_Commands... functions
    • OS_CommandsSetSep(NewSep), will let you retrieve current set of chars used by OS_Commands... functions and set your preferred one


    With those new functions you will be able to adjust depending on your needs.

    If you need this asap, I will be able to release this night (CET time) when back from work.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Need help with context menu usage and OS_GetCommand

    Ok, I had few minutes.

    Attached in this post you will find a new version of OS module: thinBasic_OS.dll
    Please download it and copy in your \thinBasic\lib\ directory replacing your current one.

    I've added the following 2 functions:
    CurrentSep = OS_CommandsGetSep
    OldSep = OS_CommandsSetSep(NewSep)

    You should be able to set the needed chars separators. Default one is: DoubleQuote + Space + Hyphen + Underscore

    Let me know if all work as it should.

    Ciao
    Eros


    PS: attached file is only for Win2K or above. It will not work for Win9x systems. It will available in double version when officially released.
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. context menu (right-cklick) help
    By largo_winch in forum UI (User Interface)
    Replies: 5
    Last Post: 09-05-2011, 12:31

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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