1. Lynn Fredricks
  2. Announcements & News
  3. 火, 2月 27 2018, 06:38 PM
  4.  メールで購読
If you are using either Valentina DB ADK or Reports ADKs with PureBasic, we now have a dedicated page on the Paradigma Software wiki discussing how to make use of Valentina C ADK for this purpose.
参照
  1. https://valentina-db.com/docs/dokuwiki/v8/doku.php?id=valentina:products:adk:purebasic
コメント
There are no comments made yet.
Johnny Harris 承諾済みの回答
Awesome!!!!
コメント
There are no comments made yet.
Lynn Fredricks 承諾済みの回答
Awesome!!!!

Hi Johnny,

Are you a regular user of PureBasic? I have to confess, I don't know much about it. Since it has been around for so long, has it taken on object or object-like properties, like Xojo?
コメント
There are no comments made yet.
Johnny Harris 承諾済みの回答
Hi Lynn,

I've not used it in a while, but there are some pretty big differences between Purebasic and Xojo. I believe Purebasic is strictly procedural, but you can do a lot with structures. From what I've read it will probably never be an OOP language.

I've used it to create small apps that I needed really quick. It has good documentation and the people in the forum are friendly and helpful. What really attracts me to Purebasic is the speed and size of the compiled apps.

Best Regards,
Johnny
コメント
There are no comments made yet.
Steve Wilson 承諾済みの回答
As Johnny said, you can do alot with PureBasic's structures.

The following example demonstrates assigning functions for working with Valentina Reports to elements in a PB structure:

Enumeration
#Valentina_Lib
EndEnumeration

Prototype Valentina_Project_Close(nProject)
Prototype Valentina_Project_New(filename$)
Prototype.i Valentina_Project_Open(nProject)
Prototype.i Valentina_Report_GetCount(nProject)
Prototype Valentina_Report_Init(macKey$,winKey$,linKey$)
Prototype.i Valentina_Report_Open(nProject,name$,datasource$,sql$)
Prototype Valentina_Report_PrintToDisk(nReport,filename$,nFormat,nFromPage,nToPage)
Prototype Valentina_Report_Shutdown()

Structure ValentinaReport
kToUnknown.i
kToMetafile.i
kToPostscript.i
kToPDF.i
kToHTML.i
kToLatex.i
kToSVG.i
kToPicture_GIF.i
kToPicture_JPG.i
kToPicture_PNG.i
kToPicture_TIFF.i
kToPicture_BMP.i
close.Valentina_Project_Close
count.Valentina_Report_GetCount
init.Valentina_Report_Init
new.Valentina_Project_New
openProject.Valentina_Project_Open
openReport.Valentina_Report_Open
printToDisk.Valentina_Report_PrintToDisk
shutdown.Valentina_Report_Shutdown
EndStructure

Procedure VP_Close(nProject)
CallFunction(#Valentina_Lib,"Project_Close",nProject)
EndProcedure

Procedure VP_New(filename$)
*bfr = UTF8(filename$)
nProject.i = CallFunction(#Valentina_Lib,"Project_New",*bfr)
FreeMemory(*bfr)
ProcedureReturn nProject
EndProcedure

Procedure VP_Open(nProject)
CallFunction(#Valentina_Lib,"Project_Open",nProject)
EndProcedure

Procedure.i VP_ReportCount()
ProcedureReturn CallFunction(#Valentina_Lib,"Project_GetReportCount",nProject)
EndProcedure

Procedure VR_Open(nProject,name$,datasource$,sql$)
*bName = UTF8(name$)
*bDatasource = UTF8(datasource$)
*bSql = UTF8(sql$)
nRes = CallFunction(#Valentina_Lib,"Project_MakeNewReportByNameWithDatasource",nProject,*bName,*bDatasource,*bSql)
FreeMemory(*bName)
FreeMemory(*bDatasource)
FreeMemory(*bSql)
ProcedureReturn nRes
EndProcedure

Procedure VP_Shutdown()
CallFunction(#Valentina_Lib,"Valentina_ShutdownReports")
EndProcedure

Procedure VR_Init(macKey$,winKey$,linKey$)
*bMkey = UTF8(macKey$)
*bWkey = UTF8(winKey$)
*bLkey = UTF8(linKey$)
CallFunction(#Valentina_Lib,"Valentina_InitReports",*bMkey,*bWkey,*bLkey)
FreeMemory(*bMkey)
FreeMemory(*bWkey)
FreeMemory(*bLkey)
EndProcedure

Procedure VR_PrintToDisk(nReport,filename$,nFormat,nFromPage,nToPage)
*bOut = UTF8(filename$)
CallFunction(#Valentina_Lib,"Report_PrintToDisk",nReport,*bOut,nFormat,nFromPage,nToPage)
FreeMemory(*bOut)
EndProcedure

Procedure.i ValentinaReports_New()
*v.ValentinaReport = AllocateStructure(ValentinaReport)
*v\kToUnknown = 0
*v\kToMetafile = 1
*v\kToPostscript = 2
*v\kToPDF = 3
*v\kToHTML = 4
*v\kToLatex = 5
*v\kToSVG = 6
*v\kToPicture_GIF = 100
*v\kToPicture_JPG = 101
*v\kToPicture_PNG = 102
*v\kToPicture_TIFF = 103
*v\kToPicture_BMP = 104
*v\close = @VP_Close()
*v\count = @VP_ReportCount()
*v\init = @VR_Init()
*v\new = @VP_New()
*v\openProject = @VP_Open()
*V\openReport = @VR_Open()
*v\printToDisk = @VR_PrintToDisk()
*v\shutdown = @VP_Shutdown()
ProcedureReturn *v
EndProcedure

CompilerIf #PB_Compiler_IsMainFile
libname$ = "libs/vcsdk_release_x64.dll"
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
libname$ = "libs/libVCSDK.so"
CompilerElseIf #PB_Compiler_OS = #PB_OS_MacOS
;libname$ = ?
CompilerEndIf

If Not OpenLibrary(#Valentina_Lib,libname$)
Debug "Could not open library"
End
EndIf

*vr.ValentinaReport = ValentinaReports_New()
*vr\init("","","")
nProject = *vr\new("reports.vsp")
If nProject
*vr\openProject(nProject)
nReport = *vr\openReport(nProject,"Report_1","sqlite://reports_db.sqlite","select * from T1")
If nReport
*vr\printToDisk(nReport,"test.pdf",*vr\kToPDF,0,0)
Else
Debug "Failed to open report"
EndIf
Else
Debug "Failed to open project"
EndIf
*vr\close(nProject)
*vr\shutdown()
FreeStructure(*vr)
CloseLibrary(#Valentina_Lib)
CompilerEndIf

コメント
There are no comments made yet.
  • ページ :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.