Moving to X# and the winner is...
Moving to X# and the winner is...
Hi, I've looked everywhere that I can think of logically for these questions, so I'll leave it here.
Take for example, this VO 2.8 code which I have poseted here before:
METHOD Start() CLASS App
LOCAL oServer as DbServer
local aDBF as array
Local cDir
cDir := WorkDir() + "Invoices"
DirMake(cDir)
cDir := WorkDir() + "Filters"
DirMake(cDir)
cDir := WorkDir() + "Original Reports"
DirMake(cDir)
request dbfcdx
RddSetDefault("DBFCDX")
Set Decimals to 2
// Create Client Database and Indexes
aDBF := {}
AAdd(aDBF, {"ClCode", "C", 10, 0})
AAdd(aDBF, {"ClName", "C", 100, 0})
AAdd(aDBF, {"ClAdd1", "C", 100, 0})
AAdd(aDBF, {"ClAdd2", "C", 100, 0})
AAdd(aDBF, {"ClState", "C", 3, 0})
AAdd(aDBF, {"ClSuburb", "C", 50, 0})
AAdd(aDBF, {"ClPhone", "C", 10, 0})
AAdd(aDBF, {"ClPcode", "C", 4, 0})
AAdd(aDBF, {"ClABN", "C", 20, 0})
AAdd(aDBF, {"ClEmail", "C", 100, 0})
AAdd(aDBF, {"ClComments", "M", 10, 0})
DBCREATE("CLIENT", aDBF, "DBFCDX")
oServer := DbServer{"Client"}
oServer:CreateOrder("CLCode", "Client","CLCode",,.T.)
oServer:CreateOrder("CLName", "Client", "ClName")
oServer:CreateOrder("ClState", "Client", "ClState")
oServer:CreateOrder("CLPcode", "Client", "ClPCode")
oServer:Commit()
oServer:Close()
//Create Details Database and Indexes
aDBF := {}
AAdd(aDBF, {"ClCode", "C", 10, 0})
AAdd(aDBF, {"ClName", "C", 100, 0})
AAdd(aDBF, {"Dname", "C", 50, 0})
AAdd(aDBF, {"JobDate", "D", 10, 0})
AAdd(aDBF, {"JobFin", "L", 1, 0})
AAdd(aDBF, {"JobTime", "C", 10, 0})
AAdd(aDBF, {"JobDetails", "M", 10, 0})
AAdd(aDBF, {"NPC", "M", 10, 0})
AAdd(aDBF, {"JobNumber", "C", 5, 0})
AAdd(aDBF, {"PONumber", "C", 15, 0})
AAdd(aDBF, {"Rate", "N", 10, 2})
AAdd(aDBF, {"Units", "N", 10, 2})
AAdd(aDBF, {"RateType", "C", 15, 0})
AAdd(aDBF, {"Subby", "C", 50, 0})
AAdd(aDBF, {"Rego", "C", 50, 0})
AAdd(aDBF, {"Invoiced", "L", 1, 0})
AAdd(aDBF, {"InvFile", "C", 250, 0})
AAdd(aDBF, {"MapFile", "C", 250, 0})
DBCREATE("Details", aDBF, "DBFCDX")
oServer := DbServer{"DETAILS"}
oServer:CreateOrder("CLCode", "Details", "CLCode" )
oServer:CreateOrder("JobDate", "Details", "JobDate")
oServer:CreateOrder("JobFin", "Details", "JobFin")
oServer:CreateOrder("JobNumber", "Details", "JobNumber")
oServer:CreateOrder("PONumber", "Details", "PONumber",, .T.)
oServer:CreateOrder("Subby", "Details", "Subby",, .T.)
oServer:CreateOrder("Rego", "Details", "Rego")
oServer:CreateOrder("Invoiced", "Details", "Invoiced")
oServer:CreateOrder("InvFile", "Details", "InvFile")
oServer:CreateOrder("MapFile", "Details", "MapFile")
oServer:Commit()
oServer:Close()
//Create JobNumber Database
aDBF := {}
AAdd(aDBF, {"JobNumber", "N", 5, 0})
DBCREATE("JobNo", aDBF, "dbfcdx")
oServer := DbServer{"JobNo"}
oServer:CreateOrder("JobNumber", "JobNo","JobNumber")
oServer:APPEND()
oServer:FIELDPUT(#JobNumber, 0)
oServer:Commit()
oServer:Close()
// Create Rates Database and Indexes
aDBF := {}
AAdd(aDBF, {"RateType", "C", 10, 0})
DBCREATE("Rates", aDBF, "DBFCDX")
oServer := DbServer{"RATES"}
oServer:APPEND()
oServer:FIELDPUT(#RateType, "Each")
oServer:APPEND()
oServer:FIELDPUT(#RateType, "Hourly")
oServer:APPEND()
oServer:FIELDPUT(#RateType, "Quoted")
oServer:APPEND()
oServer:FIELDPUT(#RateType, "Zone")
oServer:Commit()
oServer:Close()
// Create Configuration File Database
aDBF := {}
AAdd(aDBF, {"FromEmail", "C", 100, 0})
AAdd(aDBF, {"TermDays", "N", 3, 0})
AAdd(aDBF, {"EOM", "N", 3, 0})
AAdd(aDBF, {"CLName", "C", 100, 0})
AAdd(aDBF, {"ABN", "C", 15, 0})
AAdd(aDBF, {"Add1", "C", 100, 0})
AAdd(aDBF, {"Add2", "C", 100, 0})
AAdd(aDBF, {"Suburb", "C", 50, 0})
AAdd(aDBF, {"State", "C", 3, 0})
AAdd(aDBF, {"Pcode", "C", 4, 0})
AAdd(aDBF, {"Phone1", "C", 20, 0})
AAdd(aDBF, {"Email", "C", 100, 0})
AAdd(aDBF, {"TandC", "M", 10, 0})
DBCREATE("BMConfig", aDBF, "DBFCDX")
FCopy("BMInvoice.rpt", cDir + "BMInvoice.rpt")
FCopy("Blank Invoice.rpt", cDir + "Blank Invoice.rpt")
FCopy("JobNumber.rpt", cDir + "JobNumber.rpt")
FCopy("JobList.rpt", cDir + "JobList.rpt")
FCopy("WorkSheet.rpt", cDir + "WorkSheet.rpt")
FCopy("Client Details.rpt", cDir + "Client Details.rpt")
self:Quit()
Return self
I cannot see anywhere how to recode that (or something giving the same result) using X#. Is is possible? If so, how please.
I don't expect you to rewrite the entire code, just add pointers where I'm going wrong. These are just some of the errors I'm getting on compiling:
error XS9003: Pre-processor: Include file not found: 'VOSystemLibrary.vh' 4,10 Start1.prg SdiApp1
error XS9003: Pre-processor: Include file not found: 'VOSystemClasses.vh' 5,10 Start1.prg SdiApp1
error XS9002: Parser: unexpected input '{#' 337,13 Start1.prg SdiApp1
error XS9002: Parser: unexpected input '}' 337,24 Start1.prg SdiApp1
error XS9002: Parser: mismatched input 'AS' 340,14 Start1.prg SdiApp1
error XS9002: Parser: unexpected input 'RETURN' 342,9 Start1.prg SdiApp1
error XS9002: Parser: mismatched input '(' expecting EOS 342,29 Start1.prg SdiApp1
Compilation failed (7 errors)
The Return error, I'm thinking is just a complier switch, and the first two are ok also.. Others I have had say that Arrays are not applicable in X# core, dbDServer namespace error etc.
Thanks again.
Take for example, this VO 2.8 code which I have poseted here before:
METHOD Start() CLASS App
LOCAL oServer as DbServer
local aDBF as array
Local cDir
cDir := WorkDir() + "Invoices"
DirMake(cDir)
cDir := WorkDir() + "Filters"
DirMake(cDir)
cDir := WorkDir() + "Original Reports"
DirMake(cDir)
request dbfcdx
RddSetDefault("DBFCDX")
Set Decimals to 2
// Create Client Database and Indexes
aDBF := {}
AAdd(aDBF, {"ClCode", "C", 10, 0})
AAdd(aDBF, {"ClName", "C", 100, 0})
AAdd(aDBF, {"ClAdd1", "C", 100, 0})
AAdd(aDBF, {"ClAdd2", "C", 100, 0})
AAdd(aDBF, {"ClState", "C", 3, 0})
AAdd(aDBF, {"ClSuburb", "C", 50, 0})
AAdd(aDBF, {"ClPhone", "C", 10, 0})
AAdd(aDBF, {"ClPcode", "C", 4, 0})
AAdd(aDBF, {"ClABN", "C", 20, 0})
AAdd(aDBF, {"ClEmail", "C", 100, 0})
AAdd(aDBF, {"ClComments", "M", 10, 0})
DBCREATE("CLIENT", aDBF, "DBFCDX")
oServer := DbServer{"Client"}
oServer:CreateOrder("CLCode", "Client","CLCode",,.T.)
oServer:CreateOrder("CLName", "Client", "ClName")
oServer:CreateOrder("ClState", "Client", "ClState")
oServer:CreateOrder("CLPcode", "Client", "ClPCode")
oServer:Commit()
oServer:Close()
//Create Details Database and Indexes
aDBF := {}
AAdd(aDBF, {"ClCode", "C", 10, 0})
AAdd(aDBF, {"ClName", "C", 100, 0})
AAdd(aDBF, {"Dname", "C", 50, 0})
AAdd(aDBF, {"JobDate", "D", 10, 0})
AAdd(aDBF, {"JobFin", "L", 1, 0})
AAdd(aDBF, {"JobTime", "C", 10, 0})
AAdd(aDBF, {"JobDetails", "M", 10, 0})
AAdd(aDBF, {"NPC", "M", 10, 0})
AAdd(aDBF, {"JobNumber", "C", 5, 0})
AAdd(aDBF, {"PONumber", "C", 15, 0})
AAdd(aDBF, {"Rate", "N", 10, 2})
AAdd(aDBF, {"Units", "N", 10, 2})
AAdd(aDBF, {"RateType", "C", 15, 0})
AAdd(aDBF, {"Subby", "C", 50, 0})
AAdd(aDBF, {"Rego", "C", 50, 0})
AAdd(aDBF, {"Invoiced", "L", 1, 0})
AAdd(aDBF, {"InvFile", "C", 250, 0})
AAdd(aDBF, {"MapFile", "C", 250, 0})
DBCREATE("Details", aDBF, "DBFCDX")
oServer := DbServer{"DETAILS"}
oServer:CreateOrder("CLCode", "Details", "CLCode" )
oServer:CreateOrder("JobDate", "Details", "JobDate")
oServer:CreateOrder("JobFin", "Details", "JobFin")
oServer:CreateOrder("JobNumber", "Details", "JobNumber")
oServer:CreateOrder("PONumber", "Details", "PONumber",, .T.)
oServer:CreateOrder("Subby", "Details", "Subby",, .T.)
oServer:CreateOrder("Rego", "Details", "Rego")
oServer:CreateOrder("Invoiced", "Details", "Invoiced")
oServer:CreateOrder("InvFile", "Details", "InvFile")
oServer:CreateOrder("MapFile", "Details", "MapFile")
oServer:Commit()
oServer:Close()
//Create JobNumber Database
aDBF := {}
AAdd(aDBF, {"JobNumber", "N", 5, 0})
DBCREATE("JobNo", aDBF, "dbfcdx")
oServer := DbServer{"JobNo"}
oServer:CreateOrder("JobNumber", "JobNo","JobNumber")
oServer:APPEND()
oServer:FIELDPUT(#JobNumber, 0)
oServer:Commit()
oServer:Close()
// Create Rates Database and Indexes
aDBF := {}
AAdd(aDBF, {"RateType", "C", 10, 0})
DBCREATE("Rates", aDBF, "DBFCDX")
oServer := DbServer{"RATES"}
oServer:APPEND()
oServer:FIELDPUT(#RateType, "Each")
oServer:APPEND()
oServer:FIELDPUT(#RateType, "Hourly")
oServer:APPEND()
oServer:FIELDPUT(#RateType, "Quoted")
oServer:APPEND()
oServer:FIELDPUT(#RateType, "Zone")
oServer:Commit()
oServer:Close()
// Create Configuration File Database
aDBF := {}
AAdd(aDBF, {"FromEmail", "C", 100, 0})
AAdd(aDBF, {"TermDays", "N", 3, 0})
AAdd(aDBF, {"EOM", "N", 3, 0})
AAdd(aDBF, {"CLName", "C", 100, 0})
AAdd(aDBF, {"ABN", "C", 15, 0})
AAdd(aDBF, {"Add1", "C", 100, 0})
AAdd(aDBF, {"Add2", "C", 100, 0})
AAdd(aDBF, {"Suburb", "C", 50, 0})
AAdd(aDBF, {"State", "C", 3, 0})
AAdd(aDBF, {"Pcode", "C", 4, 0})
AAdd(aDBF, {"Phone1", "C", 20, 0})
AAdd(aDBF, {"Email", "C", 100, 0})
AAdd(aDBF, {"TandC", "M", 10, 0})
DBCREATE("BMConfig", aDBF, "DBFCDX")
FCopy("BMInvoice.rpt", cDir + "BMInvoice.rpt")
FCopy("Blank Invoice.rpt", cDir + "Blank Invoice.rpt")
FCopy("JobNumber.rpt", cDir + "JobNumber.rpt")
FCopy("JobList.rpt", cDir + "JobList.rpt")
FCopy("WorkSheet.rpt", cDir + "WorkSheet.rpt")
FCopy("Client Details.rpt", cDir + "Client Details.rpt")
self:Quit()
Return self
I cannot see anywhere how to recode that (or something giving the same result) using X#. Is is possible? If so, how please.
I don't expect you to rewrite the entire code, just add pointers where I'm going wrong. These are just some of the errors I'm getting on compiling:
error XS9003: Pre-processor: Include file not found: 'VOSystemLibrary.vh' 4,10 Start1.prg SdiApp1
error XS9003: Pre-processor: Include file not found: 'VOSystemClasses.vh' 5,10 Start1.prg SdiApp1
error XS9002: Parser: unexpected input '{#' 337,13 Start1.prg SdiApp1
error XS9002: Parser: unexpected input '}' 337,24 Start1.prg SdiApp1
error XS9002: Parser: mismatched input 'AS' 340,14 Start1.prg SdiApp1
error XS9002: Parser: unexpected input 'RETURN' 342,9 Start1.prg SdiApp1
error XS9002: Parser: mismatched input '(' expecting EOS 342,29 Start1.prg SdiApp1
Compilation failed (7 errors)
The Return error, I'm thinking is just a complier switch, and the first two are ok also.. Others I have had say that Arrays are not applicable in X# core, dbDServer namespace error etc.
Thanks again.
Moving to X#
Jeff,
* pls attach the zipped solution to test.
EDIT:
Started Xide, made a new SDIApp1 from samples, as probably you did (?), went to properties and clicked "Console" to see my outputs...
Now, put this in Start.prg
FUNCTION Start( asCmdLine AS STRING[] ) AS INT
//METHOD Start() CLASS App
LOCAL oServer AS DbServer
LOCAL aDBF AS ARRAY
LOCAL cDir
? cDir := WorkDir() + "Invoices"
/*DirMake(cDir)
cDir := WorkDir() + "Filters"
DirMake(cDir)
cDir := WorkDir() + "Original Reports"
DirMake(cDir)*/
wait
RETURN 1
Compiles and runs showing:
C:DevXIDEProjects4BinDebugInvoices
Now, to proceed with your DBFCDX, you HAVE to have VN runtime on your machine, as DBFCDX is not (yet) part of the runtime. If not, the CreateOrder part CAN'T work.
Karl
* pls attach the zipped solution to test.
EDIT:
Started Xide, made a new SDIApp1 from samples, as probably you did (?), went to properties and clicked "Console" to see my outputs...
Now, put this in Start.prg
FUNCTION Start( asCmdLine AS STRING[] ) AS INT
//METHOD Start() CLASS App
LOCAL oServer AS DbServer
LOCAL aDBF AS ARRAY
LOCAL cDir
? cDir := WorkDir() + "Invoices"
/*DirMake(cDir)
cDir := WorkDir() + "Filters"
DirMake(cDir)
cDir := WorkDir() + "Original Reports"
DirMake(cDir)*/
wait
RETURN 1
Compiles and runs showing:
C:DevXIDEProjects4BinDebugInvoices
Now, to proceed with your DBFCDX, you HAVE to have VN runtime on your machine, as DBFCDX is not (yet) part of the runtime. If not, the CreateOrder part CAN'T work.
Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Moving to X#
Hi Jeff,
this code should compile in X# as it is, but you have to wait for the DBFCDX RDD to be ready.
Wolfgang
this code should compile in X# as it is, but you have to wait for the DBFCDX RDD to be ready.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Moving to X#
Sorry, my bad. I must have copied the wrong piece of code. The result is still the same though...
On a completely unrelated subject... why are viaef files allowed to be uploaded while vimef files are not? Just an oversight maybe?
On a completely unrelated subject... why are viaef files allowed to be uploaded while vimef files are not? Just an oversight maybe?
- Attachments
-
[The extension viaef has been deactivated and can no longer be displayed.]
Moving to X#
Sorry, but your code Karl Returns:
error XS0246: The type or namespace name 'DbServer' could not be found (are you missing a using directive or an assembly reference?) 3,7 Start1.prg SdiApp1
Compilation failed (1 error)
error XS0246: The type or namespace name 'DbServer' could not be found (are you missing a using directive or an assembly reference?) 3,7 Start1.prg SdiApp1
Compilation failed (1 error)
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
Moving to X#
Jeff,
You need to have a reference to this Assembly in your application...
A search in the X# help file on DbServer class:BiggyRat wrote:Sorry, but your code Karl Returns:
error XS0246: The type or namespace name 'DbServer' could not be found (are you missing a using directive or an assembly reference?) 3,7 Start1.prg SdiApp1
Compilation failed (1 error)
Code: Select all
DbServer Class
Create a data server that can operate with existing .DBF database files and their associated index files.
Inheritance Hierarchy
Object
DataServer
DbServer
Namespace: VO
Assembly: VORDDClasses (in VORDDClasses.dll) Version: 2.0
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
Moving to X#
Aren't I doing that? If anything, I'm referencing far too much surely?
- Attachments
-
- Compile.JPG (32.45 KiB) Viewed 628 times
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
Moving to X#
Jeff,
Yes, drop all those Vulcan*.dll references, you not needing any Vulcan stuff, but then add VORDDClasses.dll etc.BiggyRat wrote:Aren't I doing that? If anything, I'm referencing far too much surely?
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
Moving to X#
OK Johan,
With just 4 references, I get (see 4refs.jpg):
error XS0246: The type or namespace name 'DbServer' could not be found (are you missing a using directive or an assembly reference?) 25,7 Start1.prg SdiApp1
Compilation failed (1 error)
Without the two Vulcan references shown in 4Refs.jpg, I get:
error XS9014: The dialect 'VO' requires a reference to the runtime DLLs VulcanRT.DLL and VulcanRTFuncs.DLL or XSharp.Core.DLL and XSharp.RT.DLL.
Compilation failed (1 error)
With just 4 references, I get (see 4refs.jpg):
error XS0246: The type or namespace name 'DbServer' could not be found (are you missing a using directive or an assembly reference?) 25,7 Start1.prg SdiApp1
Compilation failed (1 error)
Without the two Vulcan references shown in 4Refs.jpg, I get:
error XS9014: The dialect 'VO' requires a reference to the runtime DLLs VulcanRT.DLL and VulcanRTFuncs.DLL or XSharp.Core.DLL and XSharp.RT.DLL.
Compilation failed (1 error)
- Attachments
-
- 4refs.png (9.73 KiB) Viewed 628 times
Moving to X#
OK. For those of you playing along at home, the winning combination in this round of X# Lotto are
System
VORDDClasses
VOSystemClasses
XSharp.core
and
XSharp.RT
How'd you go at home?
However! It now gives me this.... (see attachment)
System
VORDDClasses
VOSystemClasses
XSharp.core
and
XSharp.RT
How'd you go at home?
However! It now gives me this.... (see attachment)
- Attachments
-
- more bollocks.png (54.7 KiB) Viewed 628 times