Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Filename in Basic

  • 21-02-2003 02:48PM
    #1
    Registered Users, Registered Users 2 Posts: 6,240 ✭✭✭


    Hi

    I am having a bit of trouble trying to create a file that has a space in its name.

    at the moment I have a windows dialog for open/save file
    it return the file file name
    eg.

    c:\bas\kevin\number gen\1-100.dbf

    now when I try to create this file .. it wont
    because of the space in number gen .. i presume

    does anyone know how I transfrom this file name into something I can create??

    I am using a varient of basic called power basic


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    If it's a DOS based basic then the problem may be due to the fact it doesn't support long filenames.

    In which case you would have to know the short filename.

    At a guess
    C:\BAS\KEVIN\NUMBERGR.~01\1-100.DBF
    

    I can't guarantee that though I would strongly recommend against using short file names. You would be better off conforming the directory struture to the 8.3 layout.

    If your Powerbasic does support long file names then try wrapping the name in quotes.

    eg.
    filename$ = """c:\bas\kevin\number gen\1-100.dbf"""
    
    ' or
    
    filename$ = chr$(34) + "c:\bas\kevin\number gen\1-100.dbf" + chr$(34)
    


  • Registered Users, Registered Users 2 Posts: 6,240 ✭✭✭hussey


    Thanks Hobbes

    I figured it out ...
    I was using some code I wrote ages ago
    to create a DBF file
    and in it I defined the filename to be 20 characters
    so when I tried to create something with less than that it failed


    I am much a muppet :rolleyes:


Advertisement