I can create a subroutine using doubles and integers
but the attempt at using a string just doesn't work.
What is wrong?
I do not know what default suffix is being intended.
Why is the string described as mis matched in the sub?
Code: Select all
dim as string JobFileName 'this is line 1
JobFileName="Able"
DECLARE SUB CreateNewJobFile (byval JobFileName as string)
'DECLARE SUB CreateNewJobFile (JobFileName)
SUB CreateNewJobFile (JobFileName)
'SUB CreateNewJobFile JobFileName
MKDIR JobFileName
PRINT "The directory has been created."
CHDIR JobFileName
exit sub
end sub
'main
CreateNewJobFile (JobFileName)
end 'this is line 18
/'
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
COMPILE RESULTS ATTEMPT: 1
using this
DECLARE SUB CreateNewJobFile (byval JobFileName as string)
'DECLARE SUB CreateNewJobFile (JobFileName)
SUB CreateNewJobFile (JobFileName)
'SUB CreateNewJobFile JobFileName
================
Command executed:
"C:\Program Files\FreeBASIC\fbc.exe" "C:\crap.bas" -ex
Compiler output:
C:/crap.bas(7) error 136: Default types or suffixes are only valid in -lang deprecated or qb, found ')' in 'SUB CreateNewJobFile (JobFileName)'
C:/crap.bas(7) error 55: Type mismatch, at parameter 1 (JobFileName) of CreateNewJobFile() in 'SUB CreateNewJobFile (JobFileName)'
C:/crap.bas(9) error 55: Type mismatch, at parameter 1 of MKDIR() in 'MKDIR JobFileName'
C:/crap.bas(11) error 55: Type mismatch, at parameter 1 of CHDIR() in 'CHDIR JobFileName'
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 0.17 (03-24-2007) for win32 (target:win32)
OS: Windows XP (build 2600, Service Pack 2)
===============
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
COMPILE RESULTS ATTEMPT: 2
'DECLARE SUB CreateNewJobFile (byval JobFileName as string)
DECLARE SUB CreateNewJobFile (JobFileName)
SUB CreateNewJobFile (JobFileName)
'SUB CreateNewJobFile JobFileName
================
Command executed:
"C:\Program Files\FreeBASIC\fbc.exe" "C:\crap.bas" -ex
Compiler output:
C:/crap.bas(5) error 136: Default types or suffixes are only valid in -lang deprecated or qb, found ')' in 'DECLARE SUB CreateNewJobFile (JobFileName)'
C:/crap.bas(7) error 136: Default types or suffixes are only valid in -lang deprecated or qb, found ')' in 'SUB CreateNewJobFile (JobFileName)'
C:/crap.bas(9) error 55: Type mismatch, at parameter 1 of MKDIR() in 'MKDIR JobFileName'
C:/crap.bas(10) error 3: Expected End-of-Line, found 'Command' in 'PRINT "The directory has been created."Command executed:'
C:/crap.bas(11) error 55: Type mismatch, at parameter 1 of CHDIR() in 'CHDIR JobFileName'
C:/crap.bas(16) error 55: Type mismatch, at parameter 1 (JobFileName) of CREATENEWJOBFILE() in 'CreateNewJobFile (JobFileName)'
Results:
Compilation failed
System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 0.17 (03-24-2007) for win32 (target:win32)
OS: Windows XP (build 2600, Service Pack 2)
'/