topic
stringlengths
1
63
text
stringlengths
1
577k
Convert DBF 2 SQL
Rick, We come back to the same issue ... the Memo fields. Using Access, I can import from a DBF file UNLESS it has a memo field. Then it tells me it's not the expected structure. Your example also does not create an SQL database with a memo field. Tim
Convert DBF 2 SQL
FW_AdoImportFromDBF() takes care of everything.
Convert DBF 2 SQL
Tim Add this line in the Create table command to create a memo ( data type ole object ) that will accept binary files .. like pictures etc .. [code=fw:veevmc17]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cSql += <span style="color: #ff0000;">"[MEMO] LONGBINARY NULL,"</span><br /> </div>[/code:veevmc17] [code=fw:veevmc17]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cSQL := <span style="color: #ff0000;">"CREATE TABLE CUSTOMER"</span><br />cSQL += <span style="color: #ff0000;">"( "</span><br />cSQL += <span style="color: #ff0000;">"[CUSTOMEREID] char(18) NOT NULL, "</span><br />cSQL += <span style="color: #ff0000;">"[LAST NAME] char(30) NULL, "</span><br />cSQL += <span style="color: #ff0000;">"[FIRST NAME] char(30) NULL, "</span><br />cSQL += <span style="color: #ff0000;">"[MID INIT] char(30) NULL, "</span><br />cSQL += <span style="color: #ff0000;">"[ADDRESS1] char(30) NULL, "</span><br />cSQL += <span style="color: #ff0000;">"[CITY] char(30) NULL, "</span><br />cSQL += <span style="color: #ff0000;">"[STATE] char(30) NULL, "</span><br />cSql += <span style="color: #ff0000;">"[MEMO] LONGBINARY NULL,"</span><br />cSQL += <span style="color: #ff0000;">"CONSTRAINT PK_USERINFO PRIMARY KEY ( CUSTOMEREID )"</span><br />cSQL += <span style="color: #ff0000;">" )"</span><br /><br /> </div>[/code:veevmc17] [img:veevmc17]http&#58;//i64&#46;tinypic&#46;com/3502afk&#46;jpg[/img:veevmc17] Rick Lipkin
Convert DBF 2 SQL
FWH Ado functions take care of all the issues including memo fields. Structure of \fwh\samples\wwonders.dbf: [code=fw:1xdtbhgb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #ff0000;">"NAME"</span>,  <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">0</span><br /><span style="color: #ff0000;">"IMAGE"</span>, <span style="color: #ff0000;">"M"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><br /><span style="color: #ff0000;">"NOTES"</span>, <span style="color: #ff0000;">"M"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><br /> </div>[/code:1xdtbhgb] The DBF contains two memo fields. Text is stored in the memo field "NOTES". The image itself, which is binary data, is stored in the memo field "IMAGE". FWH takes care of the memo fields including whether the memo field is text or binary. Sample: [code=fw:1xdtbhgb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oCn, oRs<br /><br />   RDDSETDEFAULT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br />   oCn   := FW_MSSQLDB<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   FW_AdoImportFromDBF<span style="color: #000000;">&#40;</span> oCn, <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\w</span>wonders.dbf"</span> <span style="color: #000000;">&#41;</span><br />   oRs   := FW_OpenRecordSet<span style="color: #000000;">&#40;</span> oCn, <span style="color: #ff0000;">"wwonders"</span> <span style="color: #000000;">&#41;</span><br />   XBROWSER oRs <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"MSSQL WWONDERS"</span><br />   oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1xdtbhgb] The program code and its functionality is the same whether the connection is to MSAccess, MS Sql Server, MySql, Oracle. [url=https&#58;//imageshack&#46;com/i/poYYGqx4p:1xdtbhgb][img:1xdtbhgb]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq90/924/YYGqx4&#46;png[/img:1xdtbhgb][/url:1xdtbhgb] Exactly the same code works with MSACCESS also, by changing only the connection. [code=fw:1xdtbhgb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oCn, oRs<br /><br />   RDDSETDEFAULT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br />   oCn   := FW_OpenAdoConnection<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\x</span>brtest.mdb"</span> <span style="color: #000000;">&#41;</span><br />   FW_AdoImportFromDBF<span style="color: #000000;">&#40;</span> oCn, <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\w</span>wonders.dbf"</span> <span style="color: #000000;">&#41;</span><br />   oRs   := FW_OpenRecordSet<span style="color: #000000;">&#40;</span> oCn, <span style="color: #ff0000;">"wwonders"</span> <span style="color: #000000;">&#41;</span><br />   XBROWSER oRs <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"MSACCESS WWONDERS"</span><br />   oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1xdtbhgb] Same code can be tried with changing the connection to MySql server or Oracle server.
Convert DBF to ADT
Thanks. I tried it but it failed, and I could not understand the error message. Would you be willing to share the source so I could see how it works ?
Convert DBF to ADT
I would like to create a utility that will take data in existing DBF files and create ADT files ( Advantage Database Server ), to include the construction of a Data Dictionary. Is there an example or esiting code ( or perhaps a viable utility ) to do this ? Thanks
Convert DBF to ADT
I made a utility for this. [b:4xnppd3e]Dbf2Advantage.exe[/b:4xnppd3e] Download and run. [url:4xnppd3e]https&#58;//github&#46;com/giovanyvecchi/tAdsGit/tree/master/Util/Dbf2Advantage[/url:4xnppd3e]
Convert DBF to ADT
Dbf2Advantage fonts are in ftp. [url:6uaiojsr]ftp&#58;//Contrib&#58;123@giovanyvecchi&#46;no-ip&#46;info&#58;97/Dbf2Advantage&#46;zip[/url:6uaiojsr] To generate it you have to add tAds source: [url:6uaiojsr]https&#58;//github&#46;com/giovanyvecchi/tAdsGit&#46;git[/url:6uaiojsr]
Convert DBF to ADT
Thanks, Giovany
Convert DDE to OLE
Hello, I want to convert DDE to OLE instruction when i establish link with WORD . How to convert this ? owrd:=Toleauto():new("word.application") owrd:visible:=.T. **** CONVERT the following in OLE Synthax **** odde:=tddemlclient():new() odde:connect("WINWORD","SYSTEM") odde:execute('[FileOpen .Name = "MODBC.doc"]') * ww:=trim(com1rec->numbon1) odde:execute('[EditReplace .Find="#NBC#",.Replace="&ww",.ReplaceAll ]') odde:execute('[EditBookmark .Name="TETETAB",.GoTo ]') ww:=str(com2rec->quant,3) odde:execute('[Insert "&ww" ]') odde:execute('[NextCell() ]') * odde:execute('[FilePrint ]') ww:="c:\word\test.doc" odde:execute('[FileSaveAs .Name ="&ww")]') odde:execute('[AppClose ]') odde:end() * Thanks for your help .
Convert DDE to OLE
No sample about this ? Thanks
Convert DDE to OLE
Jack Here is some code doing a mail merge with word - it might be of some help to you. Enrico helped me with some of this code. [code=fw:1hleihim]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> lfMailMerge<span style="color: #000000;">&#40;</span>oCode,cPath<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oWord,oDoc,cDoc,bDoc := <span style="color: #000000;">&#123;</span>|| <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#125;</span>,cCode := <span style="color: #ff0000;">''</span>,cName := <span style="color: #ff0000;">''</span>,cAddress := <span style="color: #ff0000;">''</span>,cAddress1 := <span style="color: #ff0000;">''</span>,cSuburb := <span style="color: #ff0000;">''</span>,lSingle := <span style="color: #00C800;">FALSE</span>,;<br />&nbsp; &nbsp; &nbsp; nOption := <span style="color: #000000;">0</span>,aOptions := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">'Print One'</span>,<span style="color: #ff0000;">'Print All'</span><span style="color: #000000;">&#125;</span><br /><br /><br />cDoc := cGetFile32<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'*.doc'</span><span style="color: #000000;">&#41;</span><br />bDoc := <span style="color: #000000;">&#123;</span>|| &nbsp;cDoc <span style="color: #000000;">&#125;</span><br /><br />nOption := alert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'Select Option'</span>,aOptions,<span style="color: #ff0000;">'Printing'</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">if</span> nOption == <span style="color: #000000;">1</span><br />&nbsp; &nbsp;lSingle := <span style="color: #00C800;">TRUE</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">if</span> nOption <> <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> ! oCode:<span style="color: #000000;">eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oWord := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Word.Application"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDoc := oWord:<span style="color: #000000;">Documents</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>eval<span style="color: #000000;">&#40;</span>bDoc<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDoc:<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cName &nbsp; &nbsp; := oCode:<span style="color: #00C800;">client</span><br />&nbsp; &nbsp; &nbsp; cAddress &nbsp;:= oCode:<span style="color: #000000;">address</span><br />&nbsp; &nbsp; &nbsp; cAddress1 := oCode:<span style="color: #000000;">address1</span><br />&nbsp; &nbsp; &nbsp; cSuburb &nbsp; := oCode:<span style="color: #000000;">suburb</span><br /><br />&nbsp; &nbsp; &nbsp; oSel = oWord:<span style="color: #000000;">Selection</span><br />&nbsp; &nbsp; &nbsp; WORDREPLACE<span style="color: #000000;">&#40;</span> oSel, <span style="color: #ff0000;">"#name#"</span>, ALLTRIM<span style="color: #000000;">&#40;</span>cName<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; WORDREPLACE<span style="color: #000000;">&#40;</span> oSel, <span style="color: #ff0000;">"#address#"</span>, ALLTRIM<span style="color: #000000;">&#40;</span>cAddress<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! empty<span style="color: #000000;">&#40;</span>cAddress1<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WORDREPLACE<span style="color: #000000;">&#40;</span> oSel, <span style="color: #ff0000;">"#address1#"</span>, ALLTRIM<span style="color: #000000;">&#40;</span>cAddress1<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WORDREPLACE<span style="color: #000000;">&#40;</span> oSel, <span style="color: #ff0000;">"#suburb#"</span>, ALLTRIM<span style="color: #000000;">&#40;</span>cSuburb<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WORDREPLACE<span style="color: #000000;">&#40;</span> oSel, <span style="color: #ff0000;">"#address1#"</span>, ALLTRIM<span style="color: #000000;">&#40;</span>cSuburb<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WORDREPLACE<span style="color: #000000;">&#40;</span> oSel, <span style="color: #ff0000;">"#suburb#"</span>, space<span style="color: #000000;">&#40;</span><span style="color: #000000;">60</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; MsgWait<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'Printing Document'</span>,<span style="color: #ff0000;">'Please Wait'</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDoc:<span style="color: #000000;">PrintOut</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDoc:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oWord:<span style="color: #000000;">Quit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oCode:<span style="color: #000000;">skip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lSingle<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp;SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;MsgAlert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'Finished Mail Merge'</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br />oCode:<span style="color: #000000;">Top</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">nil</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> WORDREPLACE<span style="color: #000000;">&#40;</span> oSel, cSrc, cRpl <span style="color: #000000;">&#41;</span><br />oSel:<span style="color: #000000;">Start</span> = <span style="color: #000000;">0</span><br />oSel:<span style="color: #000000;">End</span> = <span style="color: #000000;">-1</span><br /><br /><span style="color: #00C800;">WHILE</span> oSel:<span style="color: #000000;">Find</span>:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cSrc <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;oSel:<span style="color: #000000;">Range</span>:<span style="color: #0000ff;">Text</span> = cRpl<br /><span style="color: #00C800;">ENDDO</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:1hleihim] Colin
Convert DLL to LIB not work
Hi This DLL file make for .Net I use IMPLIB xxx.LIB xxx.DLL But not work. any idea for it? [quote:141nb00o] R:\Project>implib ExchangeXML_DLL.lib ExchangeXML_DLL.dll Embarcadero Implib Version 3.4.0 Copyright (c) 1991-2016 Embarcadero Technologies, Inc. Error : unable to open file [/quote:141nb00o] DLL File download <!-- m --><a class="postlink" href="http://www.fivetech.com.tw/downloads/test.zip">http://www.fivetech.com.tw/downloads/test.zip</a><!-- m --> Protocol file <!-- m --><a class="postlink" href="http://www.fivetech.com.tw/downloads/Hospital.docx">http://www.fivetech.com.tw/downloads/Hospital.docx</a><!-- m -->
Convert DLL to LIB not work
Hi Richard, i've tried it. [code=fw:1glozfyu]<div class="fw" id="{CB}" style="font-family: monospace;">implib ExchangeXML_DLL.lib ExchangeXML_DLL.dll<br /><br />Embarcadero Implib Version <span style="color: #000000;">3.4</span><span style="color: #000000;">.0</span> Copyright <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> <span style="color: #000000;">1991</span><span style="color: #000000;">-2016</span> Embarcadero Technologies, Inc.<br />Warning ExchangeXML_DLL.dll: <span style="color: #000000;">no</span> exports</div>[/code:1glozfyu] Best regards
Convert DLL to LIB not work
Richard, You can not use a .NET DLL directly from Harbour Please review this: [url:1v114ow0]https&#58;//github&#46;com/FiveTechSoft/fivenet[/url:1v114ow0]
Convert DLL to LIB not work
[quote="Antonio Linares":16nu20bn]Richard, You can not use a .NET DLL directly from Harbour Please review this: [url:16nu20bn]https&#58;//github&#46;com/FiveTechSoft/fivenet[/url:16nu20bn][/quote:16nu20bn] Antonio, I will try it. Thank you.
Convert DLL to LIB not work
[quote="Baxajaun":1vlxm8v2]Hi Richard, i've tried it. [code=fw:1vlxm8v2]<div class="fw" id="{CB}" style="font-family: monospace;">implib ExchangeXML_DLL.lib ExchangeXML_DLL.dll<br /><br />Embarcadero Implib Version <span style="color: #000000;">3.4</span><span style="color: #000000;">.0</span> Copyright <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> <span style="color: #000000;">1991</span><span style="color: #000000;">-2016</span> Embarcadero Technologies, Inc.<br />Warning ExchangeXML_DLL.dll: <span style="color: #000000;">no</span> exports</div>[/code:1vlxm8v2] Best regards[/quote:1vlxm8v2] Thank you.
Convert DOS application(s) to Harbour <== LIB compatibility
Hello! We want to convert our existing DOS application(s) to Harbour. What is going to be our damage -which libraries, we use, are not compatible- CA-Clipper (R) 5.3b (Rev. 338) RMAKE 1.5 BLINKER DOS Extender and Windows Linker 7.00 This is our link script&#058; BLINKER incremental off BLINKER EXECUTABLE CLIPPER F:127 E:2048 BLINKER EXECUTABLE EXTENDED BLINKER EXECUTABLE ALIGNMENT 128 BLINKER PROCEDURE DEPTH 100 BLINKER host message off BLINKER overlay opsize 50 BLINKER overlay pageframe ON BLINKER cache XMS 400 BLINKER cache EMS 400 STACK 16000 #map s,a OUTPUT ems.exe FILE .\obj\ems FILE .\obj\ems2 FILE .\obj\overige FILE .\obj\tn FILE .\obj\tn1 FILE .\obj\tn2 FILE .\obj\rl FILE .\obj\rl2 FILE .\obj\rl3 FILE .\obj\pr FILE .\obj\pr2 FILE .\obj\pr_toep FILE .\obj\toep_br FILE .\obj\callrap FILE .\obj\or0 FILE .\obj\or1 FILE .\obj\or2 FILE .\obj\or3 FILE .\obj\or4 FILE .\obj\or5 FILE .\obj\nc_ver FILE .\obj\nc_aan FILE .\obj\prspec FILE .\obj\ag FILE .\obj\rd FILE .\obj\hs FILE .\obj\conver FILE .\obj\rk FILE .\obj\fax #FILE .\obj\ethanol //FILE .\obj\verp_bel FILE .\obj\print FILE .\obj\getsys FILE .\obj\errorsy FILE .\obj\oops FILE .\obj\browse FILE .\obj\euro FILE .\obj\budget FILE .\obj\html FILE .\obj\div1 FILE .\obj\div2 FILE .\obj\div3 FILE .\obj\hmenu FILE .\obj\kostpr FILE .\obj\snelcalc FILE .\obj\prbudget FILE .\obj\brutow FILE .\obj\monsters FILE .\obj\alloc FILE .\obj\pr_overz FILE .\obj\vis FILE .\obj\zeevrach FILE .\obj\log_dien FILE .\obj\dien_log FILE .\obj\levtar FILE .\obj\st FILE .\obj\combi FILE .\obj\combi2 FILE .\obj\reach #FILE .\obj\party FILE .\obj\pdf FILE .\obj\rddsys FILE .\obj\__wait_b FILE ctintp FILE ctusp FILE ctrl FILE alt FILE shift #FILE cld.lib FILE .\obj\menuto SEARCH blxclp53 LIB clipper LIB dbfcdx LIB _dbfcdx LIB ctp LIB ems LIB pseudo LIB prohp LIB OSLib LIB CPMI LIB nanfor LIB Ll LIB Lfn Please let us how much re-coding would be necessary… for example is the ProHP lib compatible? Thanks in advantage. Maarten
Convert DOS application(s) to Harbour <== LIB compatibility
[quote="elrosa":of7c2ml0]Please let us how much re-coding would be necessary… for example is the ProHP lib compatible?[/quote:of7c2ml0] No Clipper 16 bit library is compatible with [x]Harbour (32 bit). Try to remove all the third party libraries from the script, look at the unresolved external that linker will list and report them here. EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Hi Enrico, thank you for the prompt reply. We haven't purchased any software yet, because I want to know first what I am looking at (a lot of recode, impossible mission) I tried HMG a while ago and encountered a lot of problems when trying to convert the Clipper app to 32/64 bits. The biggest issue I had was that the ProHP library wasn't compatible. Maarten
Convert DOS application(s) to Harbour <== LIB compatibility
[quote="elrosa":138fzeib]We haven't purchased any software yet,[/quote:138fzeib] You don't need to buy anything. Harbour or xHarbour are free opensource projects. EMG
Convert DOS application(s) to Harbour <== LIB compatibility
[quote:3cekr7dd]Try to remove all the third party libraries from the script[/quote:3cekr7dd] Well not quite sure if I blocked all 3 party libs and if they were all 3 party libs, but this is the output: [code=fw:3cekr7dd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS.OBJ<span style="color: #000000;">&#40;</span>EMS<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'LF_ISFILE'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS.OBJ<span style="color: #000000;">&#40;</span>EMS<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'LF_FERASE'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS.OBJ<span style="color: #000000;">&#40;</span>EMS<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'LF_FCREATE'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS.OBJ<span style="color: #000000;">&#40;</span>EMS<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_SETPOS'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS.OBJ<span style="color: #000000;">&#40;</span>EMS<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_FILLBOX'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS.OBJ<span style="color: #000000;">&#40;</span>EMS<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_DATA'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS.OBJ<span style="color: #000000;">&#40;</span>EMS<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_FEED'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS2.OBJ<span style="color: #000000;">&#40;</span>EMS2<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'SET2PRINT'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\EMS2.OBJ<span style="color: #000000;">&#40;</span>EMS2<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'SET2SCREEN'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN1.OBJ<span style="color: #000000;">&#40;</span>TN1<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_PAGESIZ'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN1.OBJ<span style="color: #000000;">&#40;</span>TN1<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HPSTSIZE'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN1.OBJ<span style="color: #000000;">&#40;</span>TN1<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_LMISET'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN1.OBJ<span style="color: #000000;">&#40;</span>TN1<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_CENTER'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN1.OBJ<span style="color: #000000;">&#40;</span>TN1<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_RJUST'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN1.OBJ<span style="color: #000000;">&#40;</span>TN1<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HPREPLICAT'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN1.OBJ<span style="color: #000000;">&#40;</span>TN1<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_PITCH'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN1.OBJ<span style="color: #000000;">&#40;</span>TN1<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HPLCOUNT'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN2.OBJ<span style="color: #000000;">&#40;</span>TN2<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'FT_LDAY'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\TN2.OBJ<span style="color: #000000;">&#40;</span>TN2<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'FT_MADD'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\RL.OBJ<span style="color: #000000;">&#40;</span>RL<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'OL_WINCBPA'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\RL.OBJ<span style="color: #000000;">&#40;</span>RL<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'OL_WINCBCO'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\PR.OBJ<span style="color: #000000;">&#40;</span>PR<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'LF_LIBVERS'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\PR.OBJ<span style="color: #000000;">&#40;</span>PR<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'LL_LIBVERS'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\PR.OBJ<span style="color: #000000;">&#40;</span>PR<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'LF_FRENAME'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\PR.OBJ<span style="color: #000000;">&#40;</span>PR<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'LF_DIRECTO'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\PR.OBJ<span style="color: #000000;">&#40;</span>PR<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_ORIENT'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\PR.OBJ<span style="color: #000000;">&#40;</span>PR<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_ATSAY'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\OR3.OBJ<span style="color: #000000;">&#40;</span>OR3<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_BOX'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\OR3.OBJ<span style="color: #000000;">&#40;</span>OR3<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_VLINE'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\OR3.OBJ<span style="color: #000000;">&#40;</span>OR3<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_HLINE'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\OR5.OBJ<span style="color: #000000;">&#40;</span>OR5<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HPULSTR'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\PRSPEC.OBJ<span style="color: #000000;">&#40;</span>PRSPEC<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_RCPOS'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\FAX.OBJ<span style="color: #000000;">&#40;</span>FAX<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_LPI'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\FAX.OBJ<span style="color: #000000;">&#40;</span>FAX<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_SCALEF'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_INIT'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_SEND'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_COPIES'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_RESET'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'_HPGETLINE'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HPSIZES'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HPBOLD'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_SETRES'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HPDOWNLOAD'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HPTFMERROR'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_STMACRO'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_PRPCX'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_ENDMACR'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_CALLMAC'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'PCXINFO'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\<span style="color: #00C800;">PRINT</span>.OBJ<span style="color: #000000;">&#40;</span><span style="color: #00C800;">PRINT</span><span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'HP_RASTDIR'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\GETSYS.OBJ<span style="color: #000000;">&#40;</span>GETSYS<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'OL_YIELD'</span> : <span style="color: #000000;">unresolved</span> external<br />BLINKER : <span style="color: #000000;">1115</span> : .\OBJ\MENUTO.OBJ<span style="color: #000000;">&#40;</span>MENUTO<span style="color: #000000;">&#41;</span> : <span style="color: #ff0000;">'FT_PUTKEY'</span> : <span style="color: #000000;">unresolved</span> external<br /> </div>[/code:3cekr7dd] Libs blocked are: [list:3cekr7dd]#LIB prohp #LIB OSLib #LIB CPMI #LIB nanfor #LIB Ll #LIB Lfn[/list:u:3cekr7dd]
Convert DOS application(s) to Harbour <== LIB compatibility
LF_ISFILE try using FILE 'LF_FERASE try using FERASE LF_FCREATE try using FCREATE HP_SETPOS sorry I don't know the HP* functions FT_LDAY FT_MADD you can rewrite them using standard Clipper functions OL_WINCBPA unknown OL_WINCBCO unknown LF_LIBVERS can't you remove it? LL_LIBVERS can't you remove it? LF_FRENAME try using FRENAME LF_DIRECTO try using DIRECTORY OL_YIELD not required FT_PUTKEY try using KEYBOARD EMG
Convert DOS application(s) to Harbour <== LIB compatibility
LF_ is used in LIB Ll and LIB Lfn and is a good library for using long filenames when creating PDF or other files (csv for example). So not bounded to 8 characters when creating a file name. Maarten
Convert DOS application(s) to Harbour <== LIB compatibility
Oke, I am a newbee with Harbour... what to do if I am used to create Clipper app with rmake (*.rmk file) and blinker (*.lnk file) How to do it with Harbour?
Convert DOS application(s) to Harbour <== LIB compatibility
It depends on the C compiler you are using. EMG
Convert DOS application(s) to Harbour <== LIB compatibility
I downloaded harbour-3.0.0-win.exe, so that makes the MinGW compiler.
Convert DOS application(s) to Harbour <== LIB compatibility
So you have to look at the MinGW docs. I suggest to use a simple batch (COMPILE.BAT) that: - set Harbour include directory - compile any single PRG using HARBOUR.EXE - compile any single C using MinGW - link all the OBJs (or whatever extension for object files) using the linker of MinGW EMG
Convert DOS application(s) to Harbour <== LIB compatibility
This is the buildg.bat that FWH provides: [code=fw:jquxro12]<div class="fw" id="{CB}" style="font-family: monospace;">@ECHO OFF<br />CLS<br />ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿<br />ECHO ³ FiveWin <span style="color: #00C800;">for</span> Harbour <span style="color: #000000;">16.05</span> and GCC - May &nbsp;<span style="color: #000000;">2016</span> &nbsp; Harbour development <span style="color: #0000ff;">power</span> &nbsp;³Ü<br />ECHO ³ <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> FiveTech <span style="color: #000000;">1993</span><span style="color: #000000;">-2016</span> <span style="color: #00C800;">for</span> Microsoft Windows 9X/NT/200X/ME/XP/Vista/<span style="color: #000000;">7</span>/<span style="color: #000000;">8</span>/<span style="color: #000000;">10</span> ³Û<br />ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ<br />ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß<br /><br /><span style="color: #00C800;">if</span> A%<span style="color: #000000;">1</span> == A GOTO :<span style="color: #000000;">SINTAX</span><br /><span style="color: #00C800;">if</span> NOT EXIST %<span style="color: #000000;">1</span>.prg GOTO :<span style="color: #000000;">NOEXIST</span><br /><br />ECHO Compiling...<br /><br /><span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%fwh%"</span> == <span style="color: #ff0000;">""</span> set fwh=.\..<br /><br />set hdir=c:\harbour<br />set hdirc=%hdir%\bin\harbour.exe<br />set hlibs=%hdir%\lib\gcc<br />set mingw=c:\Qt\Tools\mingw491_32<br />set path=%mingw%\bin<br /><br />%hdirc% %<span style="color: #000000;">1</span> /n /i%fwh%\include;%hdir%\include /w /p %<span style="color: #000000;">2</span> %<span style="color: #000000;">3</span> > comp.log <span style="color: #000000;">2</span>> warnings.log<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO COMPILEERROR<br />@type comp.log<br />@type warnings.log<br /><br />%mingw%\bin\gcc -c %<span style="color: #000000;">1</span>.c -o%<span style="color: #000000;">1</span>.o -I%hdir%\include -I%mingw%\include -Wall<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO COMPILEERROR<br /><br /><span style="color: #00C800;">if</span> exist %<span style="color: #000000;">1</span>.rc %mingw%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -i%<span style="color: #000000;">1</span>.rc -o_%<span style="color: #000000;">1</span>.o<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO RESOURCESERROR<br /><br /><span style="color: #00C800;">if</span> not exist %<span style="color: #000000;">1</span>.rc %mingw%\bin\gcc -o%<span style="color: #000000;">1</span>.exe %<span style="color: #000000;">1</span>.o -Wall -s -mwindows -L%mingw%\lib -L%hlibs% -L%fwh%\lib -Wl,--start-group -lfivehg -lfivehgc -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lshell32 -lmpr -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbdebug -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lhbziparc -lminizip -lhbmzip -lhbziparc -lpng -Wl,--end-group<br /><span style="color: #00C800;">if</span> exist %<span style="color: #000000;">1</span>.rc %mingw%\bin\gcc -o%<span style="color: #000000;">1</span>.exe %<span style="color: #000000;">1</span>.o _%<span style="color: #000000;">1</span>.o -Wall -s -mwindows -L%mingw%\lib -L%hlibs% -L%fwh%\lib -Wl,--start-group -lfivehg -lfivehgc -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -lmsimg32 -lwin32k -loledlg -lstdc++ -lmfcuia32 -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lshell32 -lmpr -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbdebug -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lhbziparc -lminizip -lhbmzip -lhbziparc -lpng -Wl,--end-group<br /><br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO LINKERROR<br />ECHO * Application successfully built<br />%<span style="color: #000000;">1</span><br />rem delete temporary files<br />@del %<span style="color: #000000;">1</span>.c<br />@<span style="color: #00C800;">if</span> exist %<span style="color: #000000;">1</span>.rc del _%<span style="color: #000000;">1</span>.o<br />GOTO EXIT<br />ECHO<br /><br />:<span style="color: #000000;">RESOURCESERROR</span><br />ECHO * Resources errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">COMPILEERROR</span><br />@type comp.log<br />ECHO * Compile errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">LINKERROR</span><br />ECHO * Link errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">SINTAX</span><br />ECHO &nbsp; &nbsp;SYNTAX: <span style="color: #000000;">Buildg</span> <span style="color: #000000;">&#91;</span>Program<span style="color: #000000;">&#93;</span> &nbsp; &nbsp; <span style="color: #000000;">&#123;</span>-- No especifiques la extensi¢n PRG<br />ECHO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span>-- Don<span style="color: #ff0000;">'t specify .PRG extension<br />GOTO EXIT<br /><br />:NOEXIST<br />ECHO The specified PRG %1 does not exist<br /><br />:EXIT</span></div>[/code:jquxro12]
Convert DOS application(s) to Harbour <== LIB compatibility
Hi, I create a HBP file as followed: [code=fw:3c2mcp4c]<div class="fw" id="{CB}" style="font-family: monospace;"><br /># ------------------------------------------------- --------------------------------<br /># Executable <span style="color: #0000ff;">name</span><br /># ------------------------------------------------- --------------------------------<br /># -o output file <span style="color: #0000ff;">name</span><br />-oems.exe<br /><br /># ---------------------------------------------------------------------------------<br /># Libraries<br /># ---------------------------------------------------------------------------------<br /># l Policy <span style="color: #0000ff;">to</span> link with the <span style="color: #0000ff;">library</span>. must omit path, extension, and the prefix <span style="color: #ff0000;">'lib'</span> <span style="color: #000000;">&#40;</span>... unless part <span style="color: #0000ff;">of</span> the <span style="color: #0000ff;">name</span> <span style="color: #0000ff;">of</span> file<span style="color: #000000;">&#41;</span>.<br />-lhbgt<br />-lgtwvg<br />-lgtwvt<br />-lhbct<br />-lhbwin<br />-lhbnf<br />-lxhb<br />-lhbblink<br />-lprohp<br /><br /># ---------------------------------------------------------------------------------<br /># Paths additional Includes<br /># ---------------------------------------------------------------------------------<br /># -i |-incpath=   Additional patches <span style="color: #00C800;">for</span> research headers files<br />#-incpath=<br /><br /># ---------------------------------------------------------------------------------<br /># Way <span style="color: #0000ff;">of</span> Lib PROC And HGAC <br /># ---------------------------------------------------------------------------------<br /># -L-additional path <span style="color: #0000ff;">to</span> search <span style="color: #00C800;">for</span> libraries<br />#-Li:<br />#-Ld:\users\hproc\lib;<br /><br /># ---------------------------------------------------------------------------------<br /># other Parameters<br /># ---------------------------------------------------------------------------------<br /># .\OBJ\ Writes the .s and .o files in OBJ subfolder<br /># ---------------------------------------------------------------------------------<br /># -workdir=Working directory Policy <span style="color: #0000ff;">to</span> the build working directory.<br />#                     <span style="color: #000000;">&#40;</span><span style="color: #00C800;">default</span>: .xbmc/play/comp in incremental mode, OS temp directory <span style="color: #00C800;">otherwise</span><span style="color: #000000;">&#41;</span>.<br />-workdir=.\OBJ<br />-gtgui<br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #000000;">&#91;</span>no<span style="color: #000000;">&#93;</span>head<span style="color: #000000;">&#91;</span>=<span style="color: #000000;">&#93;</span>     Control source header parsing <span style="color: #000000;">&#40;</span>in incremental build mode<span style="color: #000000;">&#41;</span><br />#                      can be: <span style="color: #000000;">native</span> <span style="color: #000000;">&#40;</span>uses compiler <span style="color: #0000ff;">to</span> extract<br />#                     dependencies<span style="color: #000000;">&#41;</span>, full <span style="color: #000000;">&#40;</span><span style="color: #00C800;">default</span>, uses simple <span style="color: #0000ff;">text</span> parser <span style="color: #0000ff;">on</span><br />#                     the whole file<span style="color: #000000;">&#41;</span>, dep, off.<br />#-head=full<br /><br /># ---------------------------------------------------------------------------------<br /># /n<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>          No implicit starting procedure<br />#                     : <span style="color: #000000;">0</span>=no implicit starting procedure<br />#                             <span style="color: #000000;">1</span>=no starting procedure <span style="color: #00C800;">at</span> all<br />#                             <span style="color: #000000;">2</span>=add starting procedure <span style="color: #00C800;">if</span> necessary<br />#-n<br /><br /># ---------------------------------------------------------------------------------<br /># -compr=def         Metodo de Compressao UPX<br />#-compr=<span style="color: #0000ff;">max</span><br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #00C800;">pause</span>         Performs a <span style="color: #00C800;">break</span> in the <span style="color: #00C800;">case</span> <span style="color: #0000ff;">of</span> compiler warning<br />#-<span style="color: #00C800;">pause</span><br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #000000;">&#91;</span>no<span style="color: #000000;">&#93;</span>warn<span style="color: #000000;">&#91;</span>=lev<span style="color: #000000;">&#93;</span>     Sets the warning level <span style="color: #000000;">&#40;</span>warning<span style="color: #000000;">&#41;</span> C compiler<br /># Can be: <span style="color: #0000ff;">max</span>, yes, low, in, def <span style="color: #000000;">&#40;</span><span style="color: #00C800;">default</span>: <span style="color: #000000;">yes</span><span style="color: #000000;">&#41;</span>.<br />#-nowarn<br /><br /># ---------------------------------------------------------------------------------<br /># -inc                Enables or incremental mode incremental.<br />#-inc<br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #000000;">&#91;</span>no<span style="color: #000000;">&#93;</span>debug          Add / Delete debug information <span style="color: #0000ff;">from</span> the C compiler<br />#                     <span style="color: #0000ff;">To</span> compile with Harbour use the -b option as usual<br />#-b<br /><br /># ---------------------------------------------------------------------------------<br /># -d        Policy <span style="color: #0000ff;">to</span> build ifdef<br />#-dHARBOUR<br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #0000ff;">icon</span>=        Arrow <span style="color: #0000ff;">icon</span> <span style="color: #00C800;">for</span> the application. must have a<br /># Format compatible with the target platform.<br /># Policy <span style="color: #0000ff;">to</span> inform the application <span style="color: #0000ff;">icon</span>.<br />#-<span style="color: #0000ff;">icon</span>=harb_win.ico<br /><br /># ---------------------------------------------------------------------------------<br /># /u<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>          Use set command <span style="color: #000000;">&#40;</span>or no<span style="color: #000000;">&#41;</span> Policy <span style="color: #0000ff;">to</span> load header file <span style="color: #000000;">&#40;</span>.c<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">for</span> all<br /># application.<br />#-u<br /><br />#-w3 -es2<br />-gui<br /><br />#-mt<br /># ---------------------------------------------------------------------------------<br /># Prg<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span> and Rc<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">of</span> the system<br /># ---------------------------------------------------------------------------------<br />overige.prg    <br />rk.prg<br />ag.prg<br />rd.prg<br />#hs.prg<br />conver.prg<br />fax.prg<br /><span style="color: #00C800;">print</span>.prg<br />browse.prg<br />getsys.prg<br />errorsy.prg<br />rddsys.prg<br />oops.prg<br />tn.prg<br />tn1.prg<br />tn2.prg<br />pr.prg<br />pr2.prg<br />pr_toep.prg<br />toep_br.prg<br />callrap.prg<br />rl.prg<br />rl2.prg<br />rl3.prg<br />or0.prg<br />or1.prg<br />or2.prg<br />or3.prg<br />or4.prg<br />or5.prg<br />nc_ver.prg<br />nc_aan.prg<br />ems.prg<br />ems2.prg<br />prspec.prg<br />euro.prg<br />budget.prg<br />html.prg<br />#party.prg<br />menuto.prg<br />div1.prg<br />div2.prg<br />div3.prg<br />hmenu.prg<br />kostpr.prg<br />snelcalc.prg<br />prbudget.prg<br />brutow.prg<br />monsters.prg<br />alloc.prg<br />pr_overz.prg<br />pdf.prg<br />vis.prg<br />combi.prg<br />combi2.prg<br />log_dien.prg<br />dien_log.prg<br />levtar.prg<br />zeevrach.prg<br />st.prg<br />reach.prg</div>[/code:3c2mcp4c] Run this script with: [code=fw:3c2mcp4c]<div class="fw" id="{CB}" style="font-family: monospace;">hbmk2 ems.bhp > comp.log <span style="color: #000000;">2</span>> warnings.log</div>[/code:3c2mcp4c] All libs are going well, except the prohp.lib. The message I am getting is: [code=fw:3c2mcp4c]<div class="fw" id="{CB}" style="font-family: monospace;">c:/hb30/lib/win/mingw/prohp.lib: <span style="color: #000000;">file</span> not recognized: <span style="color: #000000;">file</span> format not recognized.</div>[/code:3c2mcp4c] Any idea? Greetings, Maarten
Convert DOS application(s) to Harbour <== LIB compatibility
Maarten, Where have you got prohp.lib from ?
Convert DOS application(s) to Harbour <== LIB compatibility
It is our ProHP-Laser printer library, which we bought for print capabilities with our HP printers... yeaaaaaars ago.
Convert DOS application(s) to Harbour <== LIB compatibility
You need a compatible version with MinGW
Convert DOS application(s) to Harbour <== LIB compatibility
Is there a way to find out which compiler is compatible with this library? Is there a fingerprint left by the compiler used to create the prohp lib/obj?
Convert DOS application(s) to Harbour <== LIB compatibility
[quote="elrosa":22w0pdbm]Is there a way to find out which compiler is compatible with this library? Is there a fingerprint left by the compiler used to create the prohp lib/obj?[/quote:22w0pdbm] That lib is probably a 16 bit lib so it's not compatible at all with any 32 bit compiler. EMG
Convert DOS application(s) to Harbour <== LIB compatibility
I am afraid it is also <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> So that means I have to strip al print functionalities... Oslib and CTP lib are also not compatible, but do not know yet which functions are effected. Will find out after stripping print ... The Lfn lib ([url:1iexsijf]http&#58;//www&#46;ousob&#46;com/ng/lfnlib/ng1a2d0&#46;php[/url:1iexsijf]) is linked, but it doesn't work. I suppose there will be a similar function(s) which could do the same within Harbour? So probably the worst case I am looking at is rebuilding all the output forms. Any suggestions for quickly rebuilding output forms?
Convert DOS application(s) to Harbour <== LIB compatibility
Oke, dbfcdx.lib also not recognized?
Convert DOS application(s) to Harbour <== LIB compatibility
What compiler are you using? If Harbour try rddcdx.lib. EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Grrrr... let me quess... Clipper FPT isn't compatible also with Harbour <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> I cannot open any DBF with FPT associated (that is probably the DBFCDX/1001 error I am getting, because any DBF without FPT is opened with no problem) Is there a way to make these DBF/FPT Harbour compatible without losing any data in the FPT (memo) Maarten
Convert DOS application(s) to Harbour <== LIB compatibility
xHarbour: dbffpt.lib Harbour: rddfpt.lib EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Nop, still getting the 'DBFCDX/1001 Open error' message... I found the following on this board: [quote:32a2k297]If you are working with DBF/CDX/FPT files created with Clipper, Comix or Six Driver, let me tell you that those FPT files are not compatible with xHarbour FPT structure, this is due because Clipper and friends create FPT files with a "memblock" size of 16 bytes which is not compatible with (x)Harbour FPT memoblock, which is 64 bytes long, so any operation performed over the memofile will fail.[/quote:32a2k297] Is this not the problem I am facing? Here my HBP file. [code=fw:32a2k297]<div class="fw" id="{CB}" style="font-family: monospace;"><br /># ------------------------------------------------- --------------------------------<br /># Executable <span style="color: #0000ff;">name</span><br /># ------------------------------------------------- --------------------------------<br /># -o output file <span style="color: #0000ff;">name</span><br />-oems.exe<br /><br /># ---------------------------------------------------------------------------------<br /># Libraries<br /># ---------------------------------------------------------------------------------<br /># l Policy <span style="color: #0000ff;">to</span> link with the <span style="color: #0000ff;">library</span>. must omit path, extension, and the prefix <span style="color: #ff0000;">'lib'</span> <span style="color: #000000;">&#40;</span>... unless part <span style="color: #0000ff;">of</span> the <span style="color: #0000ff;">name</span> <span style="color: #0000ff;">of</span> file<span style="color: #000000;">&#41;</span>.<br /><br />-lrddfpt <br />-rddcdx <br />-lhbgt<br />-lgtwvg<br />-lgtwvt<br />-lhbct<br />-lhbwin<br />-lhbnf<br />-lxhb<br />-lhbblink<br /><br /># ---------------------------------------------------------------------------------<br /># Paths additional Includes<br /># ---------------------------------------------------------------------------------<br /># -i |-incpath=   Additional patches <span style="color: #00C800;">for</span> research headers files<br />#-incpath=<br /><br /># ---------------------------------------------------------------------------------<br /># Way <span style="color: #0000ff;">of</span> Lib PROC And HGAC <br /># ---------------------------------------------------------------------------------<br /># -L-additional path <span style="color: #0000ff;">to</span> search <span style="color: #00C800;">for</span> libraries<br />#-Li:<br />#-Ld:\users\hproc\lib;<br /><br /># ---------------------------------------------------------------------------------<br /># other Parameters<br /># ---------------------------------------------------------------------------------<br /># .\OBJ\ Writes the .s and .o files in OBJ subfolder<br /># ---------------------------------------------------------------------------------<br /># -workdir=Working directory Policy <span style="color: #0000ff;">to</span> the build working directory.<br />#                     <span style="color: #000000;">&#40;</span><span style="color: #00C800;">default</span>: .xbmc/play/comp in incremental mode, OS temp directory <span style="color: #00C800;">otherwise</span><span style="color: #000000;">&#41;</span>.<br />-workdir=.\OBJ<br />-gtgui<br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #000000;">&#91;</span>no<span style="color: #000000;">&#93;</span>head<span style="color: #000000;">&#91;</span>=<span style="color: #000000;">&#93;</span>     Control source header parsing <span style="color: #000000;">&#40;</span>in incremental build mode<span style="color: #000000;">&#41;</span><br />#                      can be: <span style="color: #000000;">native</span> <span style="color: #000000;">&#40;</span>uses compiler <span style="color: #0000ff;">to</span> extract<br />#                     dependencies<span style="color: #000000;">&#41;</span>, full <span style="color: #000000;">&#40;</span><span style="color: #00C800;">default</span>, uses simple <span style="color: #0000ff;">text</span> parser <span style="color: #0000ff;">on</span><br />#                     the whole file<span style="color: #000000;">&#41;</span>, dep, off.<br />#-head=full<br /><br /># ---------------------------------------------------------------------------------<br /># /n<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>          No implicit starting procedure<br />#                     : <span style="color: #000000;">0</span>=no implicit starting procedure<br />#                             <span style="color: #000000;">1</span>=no starting procedure <span style="color: #00C800;">at</span> all<br />#                             <span style="color: #000000;">2</span>=add starting procedure <span style="color: #00C800;">if</span> necessary<br />#-n<br /><br /># ---------------------------------------------------------------------------------<br /># -compr=def         Metodo de Compressao UPX<br />#-compr=<span style="color: #0000ff;">max</span><br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #00C800;">pause</span>         Performs a <span style="color: #00C800;">break</span> in the <span style="color: #00C800;">case</span> <span style="color: #0000ff;">of</span> compiler warning<br />#-<span style="color: #00C800;">pause</span><br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #000000;">&#91;</span>no<span style="color: #000000;">&#93;</span>warn<span style="color: #000000;">&#91;</span>=lev<span style="color: #000000;">&#93;</span>     Sets the warning level <span style="color: #000000;">&#40;</span>warning<span style="color: #000000;">&#41;</span> C compiler<br /># Can be: <span style="color: #0000ff;">max</span>, yes, low, in, def <span style="color: #000000;">&#40;</span><span style="color: #00C800;">default</span>: <span style="color: #000000;">yes</span><span style="color: #000000;">&#41;</span>.<br />#-nowarn<br /><br /># ---------------------------------------------------------------------------------<br /># -inc                Enables or incremental mode incremental.<br />#-inc<br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #000000;">&#91;</span>no<span style="color: #000000;">&#93;</span>debug          Add / Delete debug information <span style="color: #0000ff;">from</span> the C compiler<br />#                     <span style="color: #0000ff;">To</span> compile with Harbour use the -b option as usual<br />#-b<br /><br /># ---------------------------------------------------------------------------------<br /># -d        Policy <span style="color: #0000ff;">to</span> build ifdef<br />#-dHARBOUR<br /><br /># ---------------------------------------------------------------------------------<br /># -<span style="color: #0000ff;">icon</span>=        Arrow <span style="color: #0000ff;">icon</span> <span style="color: #00C800;">for</span> the application. must have a<br /># Format compatible with the target platform.<br /># Policy <span style="color: #0000ff;">to</span> inform the application <span style="color: #0000ff;">icon</span>.<br />#-<span style="color: #0000ff;">icon</span>=harb_win.ico<br /><br /># ---------------------------------------------------------------------------------<br /># /u<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>          Use set command <span style="color: #000000;">&#40;</span>or no<span style="color: #000000;">&#41;</span> Policy <span style="color: #0000ff;">to</span> load header file <span style="color: #000000;">&#40;</span>.c<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">for</span> all<br /># application.<br />#-u<br /><br />#-w3 -es2<br />-gui<br /><br />#-mt<br /># ---------------------------------------------------------------------------------<br /># Prg<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span> and Rc<span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">of</span> the system<br /># ---------------------------------------------------------------------------------<br />overige.prg    <br />rk.prg<br />ag.prg<br />rd.prg<br />hs.prg<br />conver.prg<br />fax.prg<br /><span style="color: #00C800;">print</span>.prg<br />browse.prg<br />getsys.prg<br />errorsy.prg<br />rddsys.prg<br />oops.prg<br />tn.prg<br />tn1.prg<br />tn2.prg<br />pr.prg<br />pr2.prg<br />pr_toep.prg<br />toep_br.prg<br />callrap.prg<br />rl.prg<br />rl2.prg<br />rl3.prg<br />or0.prg<br />or1.prg<br />or2.prg<br />or3.prg<br />or4.prg<br />or5.prg<br />nc_ver.prg<br />nc_aan.prg<br />ems.prg<br />ems2.prg<br />prspec.prg<br />euro.prg<br />budget.prg<br />html.prg<br />#party.prg<br />menuto.prg<br />div1.prg<br />div2.prg<br />div3.prg<br />hmenu.prg<br />kostpr.prg<br />snelcalc.prg<br />prbudget.prg<br />brutow.prg<br />monsters.prg<br />alloc.prg<br />pr_overz.prg<br />pdf.prg<br />vis.prg<br />combi.prg<br />combi2.prg<br />log_dien.prg<br />dien_log.prg<br />levtar.prg<br />zeevrach.prg<br />st.prg<br />reach.prg<br /> </div>[/code:32a2k297]
Convert DOS application(s) to Harbour <== LIB compatibility
Can you send me the DBF and the FTP to test them here? EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Done, send by wetranser to email: <!-- e --><a href="mailto:e.m.giordano@emagsoftware.it">e.m.giordano@emagsoftware.it</a><!-- e -->
Convert DOS application(s) to Harbour <== LIB compatibility
Your database opens fine here. Let's make one step at a time. Are you using Harbour or xHarbour? EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Harbour from <!-- m --><a class="postlink" href="https://sourceforge.net/projects/harbour-project/">https://sourceforge.net/projects/harbour-project/</a><!-- m --> [code=fw:1feuvng5]<div class="fw" id="{CB}" style="font-family: monospace;">hbmk2 ems.hbp > comp.log <span style="color: #000000;">2</span>> warnings.log</div>[/code:1feuvng5]
Convert DOS application(s) to Harbour <== LIB compatibility
Ok, so you have to link at least these libs: [code=fw:2ji0ayyv]<div class="fw" id="{CB}" style="font-family: monospace;">hbrtl +<br />hbvm +<br />hbcommon +<br />hbmacro +<br />gtwin +<br />hbrdd +<br />hbsix +<br />rddntx +<br />rddfpt +<br />rddcdx +<br />xhb +<br />hbwin +<br />&nbsp;</div>[/code:2ji0ayyv] EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Ok, linked the following files: [list:2qhjvvk8]-lhbrtl -lhbvm -lhbcommon -lhbmacro -lgtwin -lhbrdd -lhbsix -lrddntx -lrddfpt -lrddcdx -lxhb -lhbwin -lhbct -lhbnf[/list:u:2qhjvvk8] No compile errors, but still got the same error. [code=fw:2qhjvvk8]<div class="fw" id="{CB}" style="font-family: monospace;">  Error DBFCDX/<span style="color: #000000;">1001</span>  Open error: .\X_CT<br />  Called <span style="color: #0000ff;">from</span> DBUSEAREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />  Called <span style="color: #0000ff;">from</span> NETUSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">659</span><span style="color: #000000;">&#41;</span><br />  Called <span style="color: #0000ff;">from</span> USESAFE<span style="color: #000000;">&#40;</span><span style="color: #000000;">434</span><span style="color: #000000;">&#41;</span><br />  Called <span style="color: #0000ff;">from</span> INTRO<span style="color: #000000;">&#40;</span><span style="color: #000000;">2189</span><span style="color: #000000;">&#41;</span><br />  Called <span style="color: #0000ff;">from</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">757</span><span style="color: #000000;">&#41;</span></div>[/code:2qhjvvk8]
Convert DOS application(s) to Harbour <== LIB compatibility
Sorry, I can't help you farther. It works fine here. EMG
Convert DOS application(s) to Harbour <== LIB compatibility
May I ask how did you test the DBF which I had sent you?
Convert DOS application(s) to Harbour <== LIB compatibility
[code=fw:1qb3zics]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; USE X_CT<br /><br />&nbsp; &nbsp; ? FIELD -> prv_email<br /><br />&nbsp; &nbsp; INKEY<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1qb3zics] EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Found it! It was the rddsys.prg I linked. This gave me the problem: [code=fw:37ty041b]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/***<br />*<br />* &nbsp;RddSys.prg<br />*<br />* &nbsp;This program is run each time your application is started to setup<br />* &nbsp;the proper default driver. &nbsp;You should modify a copy of this file<br />* &nbsp;if you wish to use a default RDD other than DBFNTX.<br />*<br />* &nbsp;Copyright (c) 1993, Computer Associates International, Inc.<br />* &nbsp;All rights reserved.<br />*<br />*/</span><br /><br />ANNOUNCE RDDSYS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// This line must not change</span><br /><br /><span style="color: #0000ff;">INIT</span> PROCEDURE RddInit<br />&nbsp; &nbsp;REQUEST DBFCDX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Causes DBFNTX RDD to be linked in</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;rddSetDefault<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Set up DBFNTX as default driver</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">// eof: rddsys.prg</span></div>[/code:37ty041b]
Convert DOS application(s) to Harbour <== LIB compatibility
Great! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Thanks for (all) your help. How do i tell the compiler only to compile the PRG I changed and not all PRGs?
Convert DOS application(s) to Harbour <== LIB compatibility
You have to use a make file Here you have an example: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=28919">viewtopic.php?f=6&t=28919</a><!-- l -->
Convert DOS application(s) to Harbour <== LIB compatibility
Thank you, I will take a look at it. MemoEdit problem: [code=fw:2zqn2bwv]<div class="fw" id="{CB}" style="font-family: monospace;">MemoEdit<span style="color: #000000;">&#40;</span>tnmemo,<span style="color: #000000;">11</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">24</span>,<span style="color: #000000;">76</span>,.T.,<span style="color: #ff0000;">'MemoControl()'</span>,<span style="color: #000000;">73</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span></div>[/code:2zqn2bwv] This seems not to work anymore? Getting error Undefined function: MemoControl() Is there an example of how to use memoedit with user defined controls? Maarten
Convert DOS application(s) to Harbour <== LIB compatibility
[quote="elrosa":pbnuekhl]Thank you, I will take a look at it. MemoEdit problem: [code=fw:pbnuekhl]<div class="fw" id="{CB}" style="font-family: monospace;">MemoEdit<span style="color: #000000;">&#40;</span>tnmemo,<span style="color: #000000;">11</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">24</span>,<span style="color: #000000;">76</span>,.T.,<span style="color: #ff0000;">'MemoControl()'</span>,<span style="color: #000000;">73</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span></div>[/code:pbnuekhl] This seems not to work anymore? Getting error Undefined function: MemoControl() Is there an example of how to use memoedit with user defined controls? Maarten[/quote:pbnuekhl] Try this: [code=fw:pbnuekhl]<div class="fw" id="{CB}" style="font-family: monospace;">MemoEdit<span style="color: #000000;">&#40;</span>tnmemo,<span style="color: #000000;">11</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">24</span>,<span style="color: #000000;">76</span>,.T.,<span style="color: #ff0000;">'MemoControl'</span>,<span style="color: #000000;">73</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span></div>[/code:pbnuekhl] MemoControl without (). EMG
Convert DOS application(s) to Harbour <== LIB compatibility
Also check that MemoControl() function is not STATIC. Ie: [code=fw:qnk6xeyl]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> MemoControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:qnk6xeyl] not [code=fw:qnk6xeyl]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> MemoControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:qnk6xeyl] EMG
Convert DOS application(s) to Harbour <== LIB compatibility
<shame icon> Eh, thank you... need a holiday.. 3 hours to go. </shame icon>
Convert DOS application(s) to Harbour <== LIB compatibility
Last question before my holiday: Is there a substitute for the EGA43() and VGA28() functions? So that you can swith to 43 lines and 28 Lines?
Convert DOS application(s) to Harbour <== LIB compatibility
Try this: [code=fw:cu2lagb2]<div class="fw" id="{CB}" style="font-family: monospace;">SetMode<span style="color: #000000;">&#40;</span> <nRowCount>, <nColCount> <span style="color: #000000;">&#41;</span> --> lSuccess</div>[/code:cu2lagb2] EMG
Convert HEX vector to image
I have an image that has been stored as in HEX vector pairs format. An example is:- [code=fw:2e5kzs58]<div class="fw" id="{CB}" style="font-family: monospace;">83B483B489B294AA97A49C999E8C9B8595818C7C8279777872776A7762775B775979577A567D5680578461866<br />B867D82847E867C887B8A7B8C7B8C7BFFFF.</div>[/code:2e5kzs58] The code i have been supplied as an example is in PHP, has anybody any idea how I can covert this to run in my application and save the converted image to a file. [code=fw:2e5kzs58]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>$sig != <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span>                              <br />   $im = @ImageCreate <span style="color: #000000;">&#40;</span><span style="color: #000000;">256</span>, <span style="color: #000000;">256</span><span style="color: #000000;">&#41;</span><br />   or die <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Cannot Initialize new GD image stream"</span><span style="color: #000000;">&#41;</span>;<br />   $background_color = ImageColorAllocate <span style="color: #000000;">&#40;</span>$im, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span>;<br />   $text_color = ImageColorAllocate <span style="color: #000000;">&#40;</span>$im, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>;<br />   <br />   <span style="color: #00C800;">for</span><span style="color: #000000;">&#40;</span> $i=<span style="color: #000000;">0</span> ; $i<strlen<span style="color: #000000;">&#40;</span>$sig<span style="color: #000000;">&#41;</span> ; <span style="color: #000000;">&#41;</span><br />   <span style="color: #000000;">&#123;</span><br />           <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"FFFF"</span> || <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i<span style="color: #000000;">+4</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"FFFF"</span><span style="color: #000000;">&#41;</span><br />                   $i += <span style="color: #000000;">4</span>;<br />           <span style="color: #00C800;">else</span><br />           <span style="color: #000000;">&#123;</span><br />                   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><span style="color: #000000;">&#41;</span><br />                           $x1 = base_convert<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">16</span>,<span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span>;<br />                   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i<span style="color: #000000;">+2</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><span style="color: #000000;">&#41;</span><br />                           $y1 = base_convert<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i<span style="color: #000000;">+2</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">16</span>,<span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span>;<br />                   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i<span style="color: #000000;">+4</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><span style="color: #000000;">&#41;</span><br />                           $x2 = base_convert<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i<span style="color: #000000;">+4</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">16</span>,<span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span>;<br />                   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i<span style="color: #000000;">+6</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><span style="color: #000000;">&#41;</span><br />                           $y2 = base_convert<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>$sig,$i<span style="color: #000000;">+6</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">16</span>,<span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span>;<br />                   imageline <span style="color: #000000;">&#40;</span>$im,$x1,$y1,$x2,$y2,$text_color<span style="color: #000000;">&#41;</span>;<br />                   $i+=<span style="color: #000000;">4</span>;<br />           <span style="color: #000000;">&#125;</span><br />   <span style="color: #000000;">&#125;</span><br />   <br />   ImagePng <span style="color: #000000;">&#40;</span>$im,<span style="color: #ff0000;">"temp.png"</span><span style="color: #000000;">&#41;</span>;<br />   echo <span style="color: #ff0000;">"<img src='temp.png'>"</span>;<br /><span style="color: #000000;">&#125;</span><br /> </div>[/code:2e5kzs58] Thanks in advance Gary
Convert HEX vector to image
Gary, This is a quick try. I don't know how the image should look like, so please test it and lets see <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> [code=fw:1aqawnht]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> DrawVectors<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> DrawVectors<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cSig := <span style="color: #ff0000;">"83B483B489B294AA97A49C999E8C9B8595818C7C8279777872776A7762775B775979577A567D5680578461866"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"B867D82847E867C887B8A7B8C7B8C7BFFFF"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, nX1, nY1, nX2, nY2 <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> cSig <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"FFFF"</span> .or. <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">4</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"FFFF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n += <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nX1 = nHex<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nY1 = nHex<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nX2 = nHex<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nY2 = nHex<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MoveTo<span style="color: #000000;">&#40;</span> hDC, nX1, nY1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LineTo<span style="color: #000000;">&#40;</span> hDC, nX2, nY2 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n += <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> &nbsp; &nbsp; &nbsp; &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1aqawnht]
Convert HEX vector to image
Hi Gary, Antonio Nice translation of the original code. It might be worth looking at the logic of it because it may produce funny results if code meets "FF" in one of the tests - the corresponding value of nX1 or nX2 or nY1 or nY2 will not be set and will either be the value from the last FOR loop (would that be correct?) or nil presumably if this is the first such iteration (which will cause a run-time error I assume). n += 4 is evaluated regardless of the condition so it could be made a step value. If indeed it is an "error" to have "FF" on an even boundary then some additional logic is required and the individual tests for "FF" would make the two tests for "FFFF" redundant. I would question the logic further. It seems that all lines have to be connected with this code, that is nX2 nY2 will become nX1 nY1 on the next iteration. Is that correct or should the second n += 4 actually be an n += 8? I am unfamiliar with this format, but the above are questions and issues I would be looking into, especially if you get some unexpected results. Regards xProgrammer
Convert HEX vector to image
Hi, I just tested the conversion using [code=fw:2rz1590d]<div class="fw" id="{CB}" style="font-family: monospace;"><br />564B564B574A58495948594759455944584357415641554054404F404C404940434040423E433D453A473A49384C384<br />E35533358325B325D325F32613264366739693C6A3F6C426D457049724A724B724F72517254715570556F556E556C55<br />6953685267526651654D644C634B634A634A6249614A614E60505F515E535E545E545D565D565C575B5B5B615A645A6<br />45AFFFF6C456C456C466C486C4A6D4E6E55715C74627666786B796E7A707C737C747E767F78817A81788171806B806<br />680628060805E815E8261876689688B6C8C6C8D6B8E6A8E698F6891689265926093589451964B974797449743974297<br />3E973A973597329730972F982F9A2F9A2FFFFF<br /> </div>[/code:2rz1590d] This should be a handwritten GW but it seems to return random lines. Supposedly the php code is actually used to convert successfully though I have never seen it actually work. Regards Gary
Convert HEX vector to image
Here is the working php: [url:clb1ojpu]http&#58;//www&#46;fivetechsoft&#46;com/files/draw&#46;php[/url:clb1ojpu]
Convert HEX vector to image
Solved! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> [code=fw:wgon1bvy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> DrawVectors<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> DrawVectors<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cSig := <span style="color: #ff0000;">"564B564B574A58495948594759455944584357415641554054404F404C404940434040423E433D453A473A49384C384"</span> + ;<br /><span style="color: #ff0000;">"E35533358325B325D325F32613264366739693C6A3F6C426D457049724A724B724F72517254715570556F556E556C55"</span> + ;<br /><span style="color: #ff0000;">"6953685267526651654D644C634B634A634A6249614A614E60505F515E535E545E545D565D565C575B5B5B615A645A6"</span> + ;<br /><span style="color: #ff0000;">"45AFFFF6C456C456C466C486C4A6D4E6E55715C74627666786B796E7A707C737C747E767F78817A81788171806B806"</span> + ;<br /><span style="color: #ff0000;">"680628060805E815E8261876689688B6C8C6C8D6B8E6A8E698F6891689265926093589451964B974797449743974297"</span> + ;<br /><span style="color: #ff0000;">"3E973A973597329730972F982F9A2F9A2FFFFF"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, nX1, nY1, nX2, nY2 <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> cSig <span style="color: #000000;">&#41;</span> step <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"FFFF"</span> .or. <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">4</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"FFFF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n += <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nX1 = nHex<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nY1 = nHex<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nX2 = nHex<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"FF"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nY2 = nHex<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> cSig, n + <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MoveTo<span style="color: #000000;">&#40;</span> hDC, nX1, nY1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LineTo<span style="color: #000000;">&#40;</span> hDC, nX2, nY2 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> &nbsp; &nbsp; &nbsp; &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:wgon1bvy] [img:wgon1bvy]http&#58;//img169&#46;imageshack&#46;us/img169/803/capturesvq&#46;jpg[/img:wgon1bvy]
Convert HEX vector to image
Works perfectly thanks! Next question, How do I save the image to a file? Thanks Gary
Convert HEX vector to image
Gary, oWnd:SaveToBmp( cFileName )
Convert HEX vector to image
Dear Mr. Antonio, Similar to the subject.. How about cStr := BmpToStr( oImg:hBitmap ) to be use with this construct.. [code=fw:263dbdqs]<div class="fw" id="{CB}" style="font-family: monospace;">..<br /><span style="color: #ff0000;">"Update sql_table Set thisfield = '"</span>+cStr+<span style="color: #ff0000;">"' where field_id = 'abc' "</span> &nbsp; &nbsp;<span style="color: #B900B9;">//not saving.. &nbsp;thisfield type is blob or binary</span><br />..</div>[/code:263dbdqs] Hope you can help. Regards, FAP
Convert HEX vector to image
Frances, Do you mean that SQL errors with such string ? Maybe it has to be encoded so the bytes are not higher than some certain value. What database engine are you using ?
Convert HEX vector to image
[quote="Antonio Linares":sigka4x7]Frances, Do you mean that SQL errors with such string ? Maybe it has to be encoded so the bytes are not higher than some certain value. What database engine are you using ?[/quote:sigka4x7] Dear Mr. Antonio, I'm using ADS 9.1 There's no error but not saving cStr := Bmp2Str(oImg:hBitmap).. if using cStr := '{1231412-41234123-123423}' ..it saves the example string in BLOB field as binary.. Regards, FAP
Convert HEX vector to image
Frances, I am afraid that I don' know how to help you on that issue, Probably an ADS user may be able to help you. We use MySQL mostly here.
Convert INI files to DBF
Hello firends, A few years ago, I wanted to change my program from INI files to DBF. At that time, we developed a function to convert INI files to dbf and then to access the keys. Now I think this program can be useful for mod harbour. I think it will be easiest if you continue to use the DESKTOP program INI files online. You are used to so many entries. I am not yet sure whether you should load all INI entries into a hash at program start or if you need an entry/key then simply access the database. How do you solve the problem with the INI settings in Mod Harbour? Best regards, Otto [code=fw:3jfxhmcf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #B900B9;">/*<br />GetDBProfString( cSection, cEntry, uDefault, cIniFile )<br />- Syntax similar to GetPvProfString() function<br />- If file extention of cIniFile is "ini", then the call is forwarded to GetPvProgString().<br />&nbsp; So, in - your application you can use this function in the place of GetPvProgString at all places.<br />- Otherwise this function reads from cIniFile, forcing extention "dbf".<br />- If the dbf does not exist, returns the default value<br />- If the dbf exists, then opens the dbf and chceks for the keys<br />- If the keys exist, returns value from dbf<br />- Otherwise returns default<br /><br />WriteDBProfString( cSection, cEntry, uValue, cIniFile )<br />- Syntax similar to WritePProfString() function<br />- If file extention of cIniFile is "ini", then the call is forwarded to WritePProfString().<br />&nbsp; So, in - your application you can use this function in the place of WritePProfString at all places.<br />- Otherwise this function writes cIniFile, forcing extention "dbf".<br />- If the dbf does not exist, dbf is created<br />- Opens the dbf and chceks for the keys<br />- If the keys exist, updates the value in the dbf<br />- Otherwise appends a new entry with the values.<br /><br />EditIniDBF( cDbf )<br />- If the dbf does not exist and user wants to create, then the dbf is created<br />- User can edit values and/or append new values.<br />*/</span><br /><br />&nbsp;<span style="color: #00D7D7;">#define</span> TEST<br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">static</span> hIni &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />#ifdef TEST<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">local</span> cDbf := <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\x</span>plan_ini.dbf"</span><br /><br /><br />EditIniDBF<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #B900B9;">/* ? "test"<br /><br />&nbsp; &nbsp;? GetDBProfString( "files", "fields", 23, "rama.dbf" )<br /><br />&nbsp; &nbsp;WriteDBProfString( "files", "fields", 77, "rama.dbf" )<br />&nbsp; &nbsp;WriteDBProfString( "files", "fields", 99, "ini\ranga.dbf" )<br /><br />&nbsp; &nbsp;? GetDBProfString( "files", "fields", 23, "ini\ranga.dbf" )<br />*/</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />#endif<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> GetDBProfString<span style="color: #000000;">&#40;</span> cSection, cEntry, uDefault, cIniFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> uRet, cAlias<br /><br />&nbsp; &nbsp;cIniFile &nbsp; &nbsp;:= AllTrim<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Lower<span style="color: #000000;">&#40;</span> cFileExt<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"ini"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> GetPvProfString<span style="color: #000000;">&#40;</span> cSection, cEntry, uDefault, cIniFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;uRet &nbsp; &nbsp; &nbsp; &nbsp;:= uDefault<br />&nbsp; &nbsp;cIniFile &nbsp; &nbsp;:= TrueName<span style="color: #000000;">&#40;</span> cFileSetExt<span style="color: #000000;">&#40;</span> cIniFile, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cAlias &nbsp; &nbsp; &nbsp;:= GetIniAlias<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. Empty<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; cSection := LTrim<span style="color: #000000;">&#40;</span> cSection <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cEntry &nbsp; := LTrim<span style="color: #000000;">&#40;</span> cEntry <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSEEK<span style="color: #000000;">&#40;</span> MakeKey<span style="color: #000000;">&#40;</span> cSection, cEntry <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;uRet &nbsp;:= <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_VALUE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> uDefault <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uRet &nbsp;:= Val<span style="color: #000000;">&#40;</span> uRet <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> uRet<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> WriteDBProfString<span style="color: #000000;">&#40;</span> cSection, cEntry, uValue, cIniFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br /><br />&nbsp; &nbsp;cIniFile &nbsp; &nbsp;:= AllTrim<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Lower<span style="color: #000000;">&#40;</span> cFileExt<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"ini"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> WritePProString<span style="color: #000000;">&#40;</span> cSection, cEntry, uValue, cIniFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;cIniFile &nbsp; &nbsp;:= TrueName<span style="color: #000000;">&#40;</span> cFileSetExt<span style="color: #000000;">&#40;</span> cIniFile, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cAlias &nbsp; &nbsp; &nbsp;:= OpenIniDBF<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSEEK<span style="color: #000000;">&#40;</span> MakeKey<span style="color: #000000;">&#40;</span> cSection, cEntry <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBRLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_VALUE &nbsp;:= LTrim<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DBRUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBAPPEND<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. NetErr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_SECTION &nbsp; := LTrim<span style="color: #000000;">&#40;</span> cSection <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_KEY &nbsp; &nbsp; &nbsp; := LTrim<span style="color: #000000;">&#40;</span> cEntry <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_VALUE &nbsp; &nbsp; := LTrim<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> EditIniDBF<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br /><br />&nbsp; &nbsp;cDbf &nbsp;:= TrueName<span style="color: #000000;">&#40;</span> cFileSetExt<span style="color: #000000;">&#40;</span> cDbf, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. File<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> .not. MsgNoYes<span style="color: #000000;">&#40;</span> cDbf + <span style="color: #ff0000;">" does not exist"</span> + CRLF + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Create new DBF?"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;cAlias := OpenIniDBF<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;XBROWSER cAlias <span style="color: #0000ff;">TITLE</span> cDBF FASTEDIT<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// DO NOT CLOSE THE DBF. IT SHOULD REMAIN OPEN</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> GetIniAlias<span style="color: #000000;">&#40;</span> cIniDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br /><br />&nbsp; &nbsp;cIniDBF &nbsp; &nbsp; := UPPER<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> HHasKey<span style="color: #000000;">&#40;</span> hIni, cIniDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cAlias &nbsp; := hIni<span style="color: #000000;">&#91;</span> cIniDBF <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> .and. File<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cAlias &nbsp; := OpenIniDbf<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cAlias<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OpenIniDBF<span style="color: #000000;">&#40;</span> cIniDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. <span style="color: #000000;">&#40;</span> PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"GETINIALIAS"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cAlias &nbsp; := GetIniAlias<span style="color: #000000;">&#40;</span> @cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> .not. File<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateIniDBF<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; elseif .not. File<span style="color: #000000;">&#40;</span> cFileSetExt<span style="color: #000000;">&#40;</span> cIniDBF, <span style="color: #ff0000;">"cdx"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateIniIndex<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; cAlias &nbsp; := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"INI"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> SHARED <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp; &nbsp; SET ORDER <span style="color: #0000ff;">TO</span> TAG SECKEY<br />&nbsp; &nbsp; &nbsp; SET FILTER <span style="color: #0000ff;">TO</span> !DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; GO TOP<br />&nbsp; &nbsp; &nbsp; hIni<span style="color: #000000;">&#91;</span> Upper<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> := cAlias<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cAlias<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CreateIniDBF<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field X_SECTION, X_KEY<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPath &nbsp; &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. lIsDir<span style="color: #000000;">&#40;</span> cPath <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lMkFullPath<span style="color: #000000;">&#40;</span> cPath <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;DBCREATE<span style="color: #000000;">&#40;</span> cDbf, ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"X_SECTION"</span>, &nbsp; <span style="color: #ff0000;">"C"</span>, &nbsp;<span style="color: #000000;">30</span>, &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"X_KEY"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"C"</span>, &nbsp;<span style="color: #000000;">30</span>, &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"X_VALUE"</span>, &nbsp; &nbsp; <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">100</span>, &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"X_COMMENTS"</span>, &nbsp;<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">200</span>, &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"DBINI"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">&#40;</span>X_SECTION<span style="color: #000000;">&#41;</span>+UPPER<span style="color: #000000;">&#40;</span>X_KEY<span style="color: #000000;">&#41;</span> TAG SECKEY<br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TAG DELETED<br />&nbsp; &nbsp;CLOSE DBINI<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CreateIniIndex<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field X_SECTION, X_KEY<br /><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cDBF <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"INICDX"</span> EXCLUSIVE VIA <span style="color: #ff0000;">"DBINI"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. USED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">"Can not open "</span> + cDBF + <span style="color: #ff0000;">"Exclusively"</span><br />&nbsp; &nbsp; &nbsp; QUIT<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">&#40;</span>X_SECTION<span style="color: #000000;">&#41;</span>+UPPER<span style="color: #000000;">&#40;</span>X_KEY<span style="color: #000000;">&#41;</span> TAG SECKEY<br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TAG DELETED<br />&nbsp; &nbsp;CLOSE DBINI<br /><br /><span style="color: #00C800;">return</span> .t.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MakeKey<span style="color: #000000;">&#40;</span> cSection, cKey <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> PADR<span style="color: #000000;">&#40;</span> UPPER<span style="color: #000000;">&#40;</span> LTRIM<span style="color: #000000;">&#40;</span> cSection <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp;PADR<span style="color: #000000;">&#40;</span> UPPER<span style="color: #000000;">&#40;</span> LTRIM<span style="color: #000000;">&#40;</span> cKey &nbsp; &nbsp; <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /><br /><br /><br />&nbsp;</div>[/code:3jfxhmcf]
Convert INI files to DBF
This version includes ConvertIniToDBF( cIni ). [code=fw:2wpdcllp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;<br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #B900B9;">/*<br />GetDBProfString( cSection, cEntry, uDefault, cIniFile )<br />- Syntax similar to GetPvProfString() function<br />- If file extention of cIniFile is "ini", then the call is forwarded to GetPvProgString().<br />&nbsp; So, in - your application you can use this function in the place of GetPvProgString at all places.<br />- Otherwise this function reads from cIniFile, forcing extention "dbf".<br />- If the dbf does not exist, returns the default value<br />- If the dbf exists, then opens the dbf and chceks for the keys<br />- If the keys exist, returns value from dbf<br />- Otherwise returns default<br /><br />WriteDBProfString( cSection, cEntry, uValue, cIniFile )<br />- Syntax similar to WritePProfString() function<br />- If file extention of cIniFile is "ini", then the call is forwarded to WritePProfString().<br />&nbsp; So, in - your application you can use this function in the place of WritePProfString at all places.<br />- Otherwise this function writes cIniFile, forcing extention "dbf".<br />- If the dbf does not exist, dbf is created<br />- Opens the dbf and chceks for the keys<br />- If the keys exist, updates the value in the dbf<br />- Otherwise appends a new entry with the values.<br /><br />EditIniDBF( cDbf )<br />- If the dbf does not exist and user wants to create, then the dbf is created<br />- User can edit values and/or append new values.<br /><br />ConvertIniToDBF( cIni )<br />- Reads ini file, converts to DBF and opens the DBF for edit.<br />- If the ini file name is "myinifile.ini", dbf name is "myinifile_ini.dbf"<br />- If successful, returns the name of the dbf file<br />- On failure returns nil<br /><br />*/</span><br /><br /><span style="color: #B900B9;">/*<br /><br />// TRANSLATES TO INCLUDE IN PRG FILES OF THE PROJECT<br /><br />#xtranslate WritePProString( &nbsp; <s>, <e>, <v>, <i> ) => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WriteDBProfString( <s>, <e>, <v>, <i> )<br /><br />#xtranslate GetPvProfString( <s>, <e>, [<d>], <i> ) => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GetDBProfString( <s>, <e>, [<d>], <i> )<br /><br />*/</span><br /><br /><span style="color: #00D7D7;">#define</span> TEST<br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">static</span> hIni &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>=><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />#ifdef TEST<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cIni, cDbf<br /><br />&nbsp; &nbsp;? <span style="color: #ff0000;">"Start"</span><br /><br />&nbsp; &nbsp;cIni &nbsp;:= cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ini file(*.ini)|*.ini|"</span>, <span style="color: #ff0000;">"Select INI file to convert"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> cIni <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cDbf := ConvertIniToDbf<span style="color: #000000;">&#40;</span> cIni <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />#endif<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ConvertIniToDbf<span style="color: #000000;">&#40;</span> cIni <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPath, cDbf, cAlias<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aLines<br /><br />&nbsp; &nbsp;cIni &nbsp; &nbsp; := TrueName<span style="color: #000000;">&#40;</span> cIni <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> !File<span style="color: #000000;">&#40;</span> cIni <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">"File ->"</span> + cIni + <span style="color: #ff0000;">"<- not found"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;cPath &nbsp; &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span> cIni <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cDbf &nbsp; &nbsp; := cFileNoExt<span style="color: #000000;">&#40;</span> cIni <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cDbf &nbsp; &nbsp; := cPath + cDbf + <span style="color: #ff0000;">"_ini.dbf"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> .not. MsgNoYes<span style="color: #000000;">&#40;</span> cDbf + <span style="color: #ff0000;">" already exists"</span> + CRLF + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"OverWrite?"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> FErase<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;? cDbf + <span style="color: #ff0000;">" is in use. Can not be overwritten"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;aLines &nbsp; := IniTextAsArray<span style="color: #000000;">&#40;</span> MEMOREAD<span style="color: #000000;">&#40;</span> cIni <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;CreateIniDBF<span style="color: #000000;">&#40;</span> cDBF, aLines <span style="color: #000000;">&#41;</span><br />? <span style="color: #ff0000;">"DBF Ini wurde erstellt: &nbsp;"</span> + cDBF<br />&nbsp; &nbsp;XBROWSER cDBF <span style="color: #0000ff;">TITLE</span> cDbf FASTEDIT<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; cAlias &nbsp; &nbsp; &nbsp;:= OpenIniDBF<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .not. <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; WritePProString<span style="color: #000000;">&#40;</span> &nbsp;ALLTrim<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_SECTION <span style="color: #000000;">&#41;</span>, ALLTrim<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_KEY<span style="color: #000000;">&#41;</span>, ALLTrim<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_VALUE <span style="color: #000000;">&#41;</span>, cIni &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbskip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br /><span style="color: #00C800;">return</span> cDbf<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> GetDBProfString<span style="color: #000000;">&#40;</span> cSection, cEntry, uDefault, cIniFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> uRet, cAlias<br /><br />&nbsp; &nbsp;cIniFile &nbsp; &nbsp;:= AllTrim<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Lower<span style="color: #000000;">&#40;</span> cFileExt<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"ini"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> GetPvProfString<span style="color: #000000;">&#40;</span> cSection, cEntry, uDefault, cIniFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;uRet &nbsp; &nbsp; &nbsp; &nbsp;:= uDefault<br />&nbsp; &nbsp;cIniFile &nbsp; &nbsp;:= TrueName<span style="color: #000000;">&#40;</span> cFileSetExt<span style="color: #000000;">&#40;</span> cIniFile, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cAlias &nbsp; &nbsp; &nbsp;:= GetIniAlias<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. Empty<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; cSection := LTrim<span style="color: #000000;">&#40;</span> cSection <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cEntry &nbsp; := LTrim<span style="color: #000000;">&#40;</span> cEntry <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSEEK<span style="color: #000000;">&#40;</span> MakeKey<span style="color: #000000;">&#40;</span> cSection, cEntry <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;uRet &nbsp;:= <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_VALUE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> uDefault <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uRet &nbsp;:= Val<span style="color: #000000;">&#40;</span> uRet <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> uRet<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> WriteDBProfString<span style="color: #000000;">&#40;</span> cSection, cEntry, uValue, cIniFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br /><br />&nbsp; &nbsp;cIniFile &nbsp; &nbsp;:= AllTrim<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Lower<span style="color: #000000;">&#40;</span> cFileExt<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"ini"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> WritePProString<span style="color: #000000;">&#40;</span> cSection, cEntry, uValue, cIniFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;cIniFile &nbsp; &nbsp;:= TrueName<span style="color: #000000;">&#40;</span> cFileSetExt<span style="color: #000000;">&#40;</span> cIniFile, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cAlias &nbsp; &nbsp; &nbsp;:= OpenIniDBF<span style="color: #000000;">&#40;</span> cIniFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSEEK<span style="color: #000000;">&#40;</span> MakeKey<span style="color: #000000;">&#40;</span> cSection, cEntry <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBRLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_VALUE &nbsp;:= LTrim<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DBRUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBAPPEND<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. NetErr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_SECTION &nbsp; := LTrim<span style="color: #000000;">&#40;</span> cSection <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_KEY &nbsp; &nbsp; &nbsp; := LTrim<span style="color: #000000;">&#40;</span> cEntry <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->X_VALUE &nbsp; &nbsp; := LTrim<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> EditIniDBF<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br /><br />&nbsp; &nbsp;cDbf &nbsp;:= TrueName<span style="color: #000000;">&#40;</span> cFileSetExt<span style="color: #000000;">&#40;</span> cDbf, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. File<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> .not. MsgNoYes<span style="color: #000000;">&#40;</span> cDbf + <span style="color: #ff0000;">" does not exist"</span> + CRLF + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Create new DBF?"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;cAlias := OpenIniDBF<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;XBROWSER cAlias <span style="color: #0000ff;">TITLE</span> cDBF FASTEDIT<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #B900B9;">// DO NOT CLOSE THE DBF. IT SHOULD REMAIN OPEN</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> GetIniAlias<span style="color: #000000;">&#40;</span> cIniDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br /><br />&nbsp; &nbsp;cIniDBF &nbsp; &nbsp; := UPPER<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> HHasKey<span style="color: #000000;">&#40;</span> hIni, cIniDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cAlias &nbsp; := hIni<span style="color: #000000;">&#91;</span> cIniDBF <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> .and. File<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cAlias &nbsp; := OpenIniDbf<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cAlias<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OpenIniDBF<span style="color: #000000;">&#40;</span> cIniDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. <span style="color: #000000;">&#40;</span> PROCNAME<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"GETINIALIAS"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cAlias &nbsp; := GetIniAlias<span style="color: #000000;">&#40;</span> @cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> .not. File<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateIniDBF<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; elseif .not. File<span style="color: #000000;">&#40;</span> cFileSetExt<span style="color: #000000;">&#40;</span> cIniDBF, <span style="color: #ff0000;">"cdx"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CreateIniIndex<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; cAlias &nbsp; := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"INI"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> SHARED <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp; &nbsp; SET ORDER <span style="color: #0000ff;">TO</span> TAG SECKEY<br />&nbsp; &nbsp; &nbsp; SET FILTER <span style="color: #0000ff;">TO</span> !DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; GO TOP<br />&nbsp; &nbsp; &nbsp; hIni<span style="color: #000000;">&#91;</span> Upper<span style="color: #000000;">&#40;</span> cIniDBF <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> := cAlias<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cAlias<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CreateIniDBF<span style="color: #000000;">&#40;</span> cDbf, aData <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field X_SECTION, X_KEY<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPath &nbsp; &nbsp;:= cFilePath<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. lIsDir<span style="color: #000000;">&#40;</span> cPath <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lMkFullPath<span style="color: #000000;">&#40;</span> cPath <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;DBCREATE<span style="color: #000000;">&#40;</span> cDbf, ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"X_SECTION"</span>, &nbsp; <span style="color: #ff0000;">"C"</span>, &nbsp;<span style="color: #000000;">100</span>, &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"X_KEY"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"C"</span>, &nbsp;<span style="color: #000000;">100</span>, &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"X_VALUE"</span>, &nbsp; &nbsp; <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">200</span>, &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"X_COMMENTS"</span>, &nbsp;<span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">200</span>, &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"DBINI"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">&#40;</span>X_SECTION<span style="color: #000000;">&#41;</span>+UPPER<span style="color: #000000;">&#40;</span>X_KEY<span style="color: #000000;">&#41;</span> TAG SECKEY<br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TAG DELETED<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DBINI-><span style="color: #000000;">&#40;</span> FW_ArrayToDBF<span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;CLOSE DBINI<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CreateIniIndex<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field X_SECTION, X_KEY<br /><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cDBF <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"INICDX"</span> EXCLUSIVE VIA <span style="color: #ff0000;">"DBINI"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not. USED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">"Can not open "</span> + cDBF + <span style="color: #ff0000;">"Exclusively"</span><br />&nbsp; &nbsp; &nbsp; QUIT<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">&#40;</span>X_SECTION<span style="color: #000000;">&#41;</span>+UPPER<span style="color: #000000;">&#40;</span>X_KEY<span style="color: #000000;">&#41;</span> TAG SECKEY<br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> TAG DELETED<br />&nbsp; &nbsp;CLOSE DBINI<br /><br /><span style="color: #00C800;">return</span> .t.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MakeKey<span style="color: #000000;">&#40;</span> cSection, cKey <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> PADR<span style="color: #000000;">&#40;</span> UPPER<span style="color: #000000;">&#40;</span> LTRIM<span style="color: #000000;">&#40;</span> cSection <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp;PADR<span style="color: #000000;">&#40;</span> UPPER<span style="color: #000000;">&#40;</span> LTRIM<span style="color: #000000;">&#40;</span> cKey &nbsp; &nbsp; <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> IniTextAsArray<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aLines, tmp, n, cLine<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cSection, aLine, c1, c2<br /><br />&nbsp; &nbsp;cText &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> cText, CRLF, Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aLines &nbsp; := HB_ATokens<span style="color: #000000;">&#40;</span> cText, Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> aLines, <span style="color: #000000;">&#123;</span> |c,i| aLines<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> := AllTrim<span style="color: #000000;">&#40;</span> c <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;tmp &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> aLines, <span style="color: #000000;">&#123;</span> |c| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> c <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span>, AAdd<span style="color: #000000;">&#40;</span> tmp, c <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;aLines &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each cLine in tmp<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span> cLine, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> &nbsp;== <span style="color: #ff0000;">"["</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span> cLine, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"]"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSection := CharRem<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"[]"</span>, cLine <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #ff0000;">"="</span> $ cLine<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c1 &nbsp; &nbsp;:= Trim<span style="color: #000000;">&#40;</span> &nbsp;BeforAtNum<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"="</span>, cLine, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c2 &nbsp; &nbsp;:= LTrim<span style="color: #000000;">&#40;</span> AfterAtNum<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"="</span>, cLine, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c1 &nbsp; &nbsp;:= cLine<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c2 &nbsp; &nbsp;:= <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aLines, <span style="color: #000000;">&#123;</span> cSection, c1, c2, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> aLines<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">/*<br />#xtranslate WritePProString( &nbsp; <s>, <e>, <v>, <i> ) => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WriteDBProfString( <s>, <e>, <v>, <i> )<br /><br />#xtranslate GetPvProfString( <s>, <e>, [<d>], <i> ) => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GetDBProfString( <s>, <e>, [<d>], <i> )<br />*/</span><br /><br /><br />&nbsp;</div>[/code:2wpdcllp]
Convert Java to FWH 2011.08
Hello, I have two code snipets that I need converted to FWH, can someone help convert for me? I am happy to pay someone for their time. Please send me an e-mail at Darrell.Ortiz AT cdmsoft.com if you are interested. Thank you, // CODE 1----------------------------------------------------------------------------- import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; import java.util.Date; public class TcpClientUtil { private static final int BUFSIZE = 50; Socket socket = null; OutputStream out = null; InputStream in = null; BufferedOutputStream bufferedOutputStream=null; BufferedInputStream bufferedInputStream =null; String hostServer = "192.168.1.107"; //149.99.39.146 int hostPort = 9100;//50030 int socketTimeout = 10000; boolean connected = false; FileWriter s; Charset charset = Charset.forName("ISO-8859-1"); CharsetDecoder decoder = charset.newDecoder(); CharsetEncoder encoder = charset.newEncoder(); public TcpClientUtil() { } public TcpClientUtil(String HostServer, int HostPort, int SocketTimeout){ hostServer = HostServer; hostPort = HostPort; socketTimeout = SocketTimeout; } public FileWriter getLogger() { return s; } public void setLogger(FileWriter s) { this.s = s; } public boolean ConnectSocket() { //Create socket connection try { if(socket == null) { socket = new Socket(); socket.connect(new InetSocketAddress(hostServer, hostPort), socketTimeout); connected = true; bufferedOutputStream = new BufferedOutputStream(socket.getOutputStream()); bufferedInputStream = new BufferedInputStream(socket.getInputStream()); } } catch (UnknownHostException e) { System.out.println("Unknown host: kq6py.eng"); //System.exit(1); connected = false; } catch (IOException e) { System.out.println("No I/O"); // System.exit(1); connected = false; } return connected; } private boolean DisconnectSocket(){ try { if(socket!=null) { bufferedInputStream.close(); socket.close(); connected = false; } } catch (IOException e) { System.out.println("Could not close socket"); System.exit(-1); connected = false; } return connected; } public String SendRequest(String dataPacket){ String result = ""; byte[] bsRequest = null; byte[] bsResponse = new byte[BUFSIZE]; int rcvMsgSize; try{ //Encode request System.out.println(new Date().toString() + " : Start Encode Request.") ; //s.write(new Date().toString() + " : Start Encode Request.\r\n"); bsRequest = dataPacket.getBytes(); System.out.println(new Date().toString() + " : Stop Encode Request.") ; //s.write(new Date().toString() + " : Stop Encode Request.\r\n"); //Send Request if(bsRequest != null){ System.out.println(new Date().toString() + " : Start Writing Request to socket.") ; //s.write(new Date().toString() + " : Start Writing Request to socket.\r\n"); for (int u = 0; u < bsRequest.length; u++) { try { //out.write(bsRequest[u]); bufferedOutputStream.write(bsRequest[u]); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } bufferedOutputStream.flush(); System.out.println("Sent data packet to printer"); boolean disconnected = DisconnectSocket(); System.out.println("Disconnected from printer"); } }catch(Exception ex){ result = "ERROR : " + ex.getMessage(); } return result; } private byte[] getDataPacket(String data){ byte[] b = null; try{ String dataPacket = FileUtil.getContentsAsString("D:\\Argo Wireless\\Code\\sourcetag\\pocs\\TagPrintingPOC\\labels\\from Vijay\\Test.zpl"); b = dataPacket.getBytes(); }catch(Exception ex){ System.out.println(ex.getMessage()); } return b; } private byte[] concat(byte[] bs1, byte[] bs2) { byte[] returnArray = new byte[bs1.length + bs2.length]; System.arraycopy(bs1, 0, returnArray, 0, bs1.length); System.arraycopy(bs2, 0, returnArray, bs1.length, bs2.length); return returnArray; } private String DecodeDataPacket(byte[] bs){ String result = null; try{ result = new String(bs,"US-ASCII"); }catch(Exception ex){ result = "ERROR : " + ex.getMessage(); } return result; } } // CODE 2----------------------------------------------------------------------------- private boolean printTags(String dataPacket, String hostName){ boolean result = false; try{ //Connect to Server TcpClientUtil printer = new TcpClientUtil(hostName, Integer.parseInt(printerport), Integer.parseInt(printerconnectiontimeout)); boolean connected = printer.ConnectSocket(); if(connected == true){ logger.info(new Date().toString() + " : Connected To Printer.\r\n"); String response = printer.SendRequest(dataPacket); return true; } }catch(Exception ex){ logger.info(new Date().toString() + " : " + ex.getMessage()); return false; } return result; }
Convert Java to FWH 2011.08
I think straigt converting Java to xBase-syntax will be hard. I found a Tool converting Java to C++. C++ You can include in Your App. Maybe it works for You. You can try without risk, before buy. The Demo accepts Lines enaugh, converting Your Function. <!-- m --><a class="postlink" href="http://www.tangiblesoftwaresolutions.com/">http://www.tangiblesoftwaresolutions.com/</a><!-- m --> [img:e5cj5egs]http&#58;//www&#46;pflegeplus&#46;com/pictures/java&#46;jpg[/img:e5cj5egs] [color=#FF0000:e5cj5egs]Result in C++ of Your Java-code :[/color:e5cj5egs] [color=#0000FF:e5cj5egs]Test.ccp [/color:e5cj5egs] [code=fw:e5cj5egs]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Test.h"</span><br /><br />TcpClientUtil::<span style="color: #000000;">TcpClientUtil</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br />    InitializeInstanceFields<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br />TcpClientUtil::<span style="color: #000000;">TcpClientUtil</span><span style="color: #000000;">&#40;</span>const std::<span style="color: #000000;">string</span> &HostServer, int HostPort, int SocketTimeout<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />InitializeInstanceFields<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />hostServer = HostServer;<br />hostPort = HostPort;<br />socketTimeout = SocketTimeout;<br /><br /><span style="color: #000000;">&#125;</span><br /><br />FileWriter *TcpClientUtil::<span style="color: #000000;">getLogger</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #00C800;">return</span> s;<br /><span style="color: #000000;">&#125;</span><br /><br />void TcpClientUtil::<span style="color: #000000;">setLogger</span><span style="color: #000000;">&#40;</span>FileWriter *s<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />this->s = s;<br /><span style="color: #000000;">&#125;</span><br /><br />bool TcpClientUtil::<span style="color: #000000;">ConnectSocket</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #B900B9;">//Create socket connection</span><br /><span style="color: #00C800;">try</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>socket == <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />socket = <span style="color: #00C800;">new</span> Socket<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />socket->connect<span style="color: #000000;">&#40;</span><span style="color: #00C800;">new</span> InetSocketAddress<span style="color: #000000;">&#40;</span>hostServer, hostPort<span style="color: #000000;">&#41;</span>, socketTimeout<span style="color: #000000;">&#41;</span>;<br /><br />connected = <span style="color: #00C800;">true</span>;<br />bufferedOutputStream = <span style="color: #00C800;">new</span> BufferedOutputStream<span style="color: #000000;">&#40;</span>socket->getOutputStream<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />bufferedInputStream = <span style="color: #00C800;">new</span> BufferedInputStream<span style="color: #000000;">&#40;</span>socket->getInputStream<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#125;</span><br />catch <span style="color: #000000;">&#40;</span>UnknownHostException *e<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />puts<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Unknown host: kq6py.eng"</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #B900B9;">//System.exit(1);</span><br />connected = <span style="color: #00C800;">false</span>;<br /><br /><span style="color: #000000;">&#125;</span><br />catch <span style="color: #000000;">&#40;</span>IOException *e<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />puts<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No I/O"</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #B900B9;">// System.exit(1);</span><br />connected = <span style="color: #00C800;">false</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">return</span> connected;<br /><br /><span style="color: #000000;">&#125;</span><br /><br />bool TcpClientUtil::<span style="color: #000000;">DisconnectSocket</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #00C800;">try</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>socket != <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />bufferedInputStream->close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />socket->close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />connected = <span style="color: #00C800;">false</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#125;</span><br />catch <span style="color: #000000;">&#40;</span>IOException *e<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />puts<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Could not close socket"</span><span style="color: #000000;">&#41;</span>;<br />exit<span style="color: #000000;">&#40;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span>;<br />connected = <span style="color: #00C800;">false</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">return</span> connected;<br /><span style="color: #000000;">&#125;</span><br /><br />std::<span style="color: #000000;">string</span> TcpClientUtil::<span style="color: #000000;">SendRequest</span><span style="color: #000000;">&#40;</span>const std::<span style="color: #000000;">string</span> &dataPacket<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br />std::<span style="color: #000000;">string</span> result = <span style="color: #ff0000;">""</span>;<br /><span style="color: #B900B9;">//ORIGINAL LINE: byte[] bsRequest = nullptr;</span><br /><span style="color: #B900B9;">//JAVA TO C++ CONVERTER WARNING: Since the array size is not known in this declaration, Java to C++ Converter has converted this array to a pointer.  You will need to call 'delete[]' where appropriate:</span><br />char *bsRequest = <span style="color: #000000;">0</span>;<br />char bsResponse<span style="color: #000000;">&#91;</span>BUFSIZE<span style="color: #000000;">&#93;</span>;<br />int rcvMsgSize;<br /><br /><span style="color: #00C800;">try</span><br /><span style="color: #000000;">&#123;</span><br /><br /><span style="color: #B900B9;">//Encode request</span><br /><span style="color: #B900B9;">//JAVA TO C++ CONVERTER TODO TASK: There is no native C++ equivalent to 'toString':</span><br />puts<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.toString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" : Start Encode Request."</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #B900B9;">//s.write(new Date().toString() + " : Start Encode Request.\r\n");</span><br />bsRequest = dataPacket.getBytes<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #B900B9;">//JAVA TO C++ CONVERTER TODO TASK: There is no native C++ equivalent to 'toString':</span><br />puts<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.toString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" : Stop Encode Request."</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #B900B9;">//s.write(new Date().toString() + " : Stop Encode Request.\r\n"); </span><br /><br /><span style="color: #B900B9;">//Send Request</span><br /><span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>bsRequest != <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br /><span style="color: #B900B9;">//JAVA TO C++ CONVERTER TODO TASK: There is no native C++ equivalent to 'toString':</span><br />puts<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.toString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" : Start Writing Request to socket."</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #B900B9;">//s.write(new Date().toString() + " : Start Writing Request to socket.\r\n");</span><br /><br /><span style="color: #00C800;">for</span> <span style="color: #000000;">&#40;</span>int u = <span style="color: #000000;">0</span>; u < sizeof<span style="color: #000000;">&#40;</span>bsRequest<span style="color: #000000;">&#41;</span> / sizeof<span style="color: #000000;">&#40;</span>bsRequest<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>; u++<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #00C800;">try</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #B900B9;">//out.write(bsRequest[u]);</span><br />bufferedOutputStream->write<span style="color: #000000;">&#40;</span>bsRequest<span style="color: #000000;">&#91;</span>u<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br />catch <span style="color: #000000;">&#40;</span>IOException *e<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #B900B9;">// TODO Auto-generated catch block</span><br />e->printStackTrace<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#125;</span><br />bufferedOutputStream->flush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />puts<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Sent data packet to printer"</span><span style="color: #000000;">&#41;</span>;<br /><br />bool disconnected = DisconnectSocket<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />puts<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Disconnected from printer"</span><span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #000000;">&#125;</span><br />catch <span style="color: #000000;">&#40;</span>Exception *ex<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br />result = <span style="color: #ff0000;">"ERROR : "</span> + ex->getMessage<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">return</span> result;<br /><span style="color: #000000;">&#125;</span><br /><br />char *TcpClientUtil::<span style="color: #000000;">getDataPacket</span><span style="color: #000000;">&#40;</span>const std::<span style="color: #000000;">string</span> &data<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br /><span style="color: #B900B9;">//ORIGINAL LINE: byte[] b = nullptr;</span><br /><span style="color: #B900B9;">//JAVA TO C++ CONVERTER WARNING: Since the array size is not known in this declaration, Java to C++ Converter has converted this array to a pointer.  You will need to call 'delete[]' where appropriate:</span><br />char *b = <span style="color: #000000;">0</span>;<br /><br /><span style="color: #00C800;">try</span><br /><span style="color: #000000;">&#123;</span><br /><br />std::<span style="color: #000000;">string</span> dataPacket = FileUtil::<span style="color: #000000;">getContentsAsString</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"D:<span style="color: #000000;">\\</span>Argo Wireless<span style="color: #000000;">\\</span>Code<span style="color: #000000;">\\</span>sourcetag<span style="color: #000000;">\\</span>pocs<span style="color: #000000;">\\</span>TagPrintingPOC<span style="color: #000000;">\\</span>labels<span style="color: #000000;">\\</span>from Vijay<span style="color: #000000;">\\</span>Test.zpl"</span><span style="color: #000000;">&#41;</span>;<br /><br />b = dataPacket.getBytes<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #000000;">&#125;</span><br />catch <span style="color: #000000;">&#40;</span>Exception *ex<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br />puts<span style="color: #000000;">&#40;</span>ex->getMessage<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">return</span> b;<br /><br /><span style="color: #000000;">&#125;</span><br /><br />char *TcpClientUtil::<span style="color: #000000;">concat</span><span style="color: #000000;">&#40;</span>char bs1<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>, char bs2<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />char returnArray<span style="color: #000000;">&#91;</span>sizeof<span style="color: #000000;">&#40;</span>bs1<span style="color: #000000;">&#41;</span> / sizeof<span style="color: #000000;">&#40;</span>bs1<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> + sizeof<span style="color: #000000;">&#40;</span>bs2<span style="color: #000000;">&#41;</span> / sizeof<span style="color: #000000;">&#40;</span>bs2<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>;<br />System::<span style="color: #000000;">arraycopy</span><span style="color: #000000;">&#40;</span>bs1, <span style="color: #000000;">0</span>, returnArray, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">&#40;</span>bs1<span style="color: #000000;">&#41;</span> / sizeof<span style="color: #000000;">&#40;</span>bs1<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />System::<span style="color: #000000;">arraycopy</span><span style="color: #000000;">&#40;</span>bs2, <span style="color: #000000;">0</span>, returnArray, sizeof<span style="color: #000000;">&#40;</span>bs1<span style="color: #000000;">&#41;</span> / sizeof<span style="color: #000000;">&#40;</span>bs1<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>, sizeof<span style="color: #000000;">&#40;</span>bs2<span style="color: #000000;">&#41;</span> / sizeof<span style="color: #000000;">&#40;</span>bs2<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #00C800;">return</span> returnArray;<br /><span style="color: #000000;">&#125;</span><br /><br />std::<span style="color: #000000;">string</span> TcpClientUtil::<span style="color: #000000;">DecodeDataPacket</span><span style="color: #000000;">&#40;</span>char bs<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br />std::<span style="color: #000000;">string</span> result = <span style="color: #ff0000;">""</span>;<br /><span style="color: #00C800;">try</span><br /><span style="color: #000000;">&#123;</span><br />result = std::<span style="color: #000000;">string</span><span style="color: #000000;">&#40;</span>bs,<span style="color: #ff0000;">"US-ASCII"</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br />catch <span style="color: #000000;">&#40;</span>Exception *ex<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />result = <span style="color: #ff0000;">"ERROR : "</span> + ex->getMessage<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">return</span> result;<br /><span style="color: #000000;">&#125;</span><br /><br />void TcpClientUtil::<span style="color: #000000;">InitializeInstanceFields</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />    delete socket;<br />    delete out;<br />    delete in_Renamed;<br />    delete bufferedOutputStream;<br />    delete bufferedInputStream;<br />    hostServer = <span style="color: #ff0000;">"192.168.1.107"</span>;<br />    hostPort = <span style="color: #000000;">9100</span>;<br />    socketTimeout = <span style="color: #000000;">10000</span>;<br />    connected = <span style="color: #00C800;">false</span>;<br />    charset = java::<span style="color: #000000;">nio</span>::<span style="color: #000000;">charset</span>::<span style="color: #000000;">Charset</span>::<span style="color: #000000;">forName</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ISO-8859-1"</span><span style="color: #000000;">&#41;</span>;<br />    decoder = charset->newDecoder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />    encoder = charset->newEncoder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br />bool <missing_class_definition>::<span style="color: #000000;">result</span> = <span style="color: #00C800;">false</span>;<br /> </div>[/code:e5cj5egs] [color=#0000FF:e5cj5egs]Test.h[/color:e5cj5egs] [code=fw:e5cj5egs]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#pragma</span> once<br /><br /><span style="color: #00D7D7;">#include</span> <string><br /><br /><span style="color: #00C800;">class</span> TcpClientUtil<br /><span style="color: #000000;">&#123;</span><br /><br /><span style="color: #00C800;">private</span>:<br /><span style="color: #00C800;">static</span> const int BUFSIZE = <span style="color: #000000;">50</span>;<br /><br /><span style="color: #00C800;">public</span>:<br /><span style="color: #000000;">Socket</span> *socket;<br />OutputStream *out;<br />InputStream *in_Renamed;<br />BufferedOutputStream *bufferedOutputStream;<br />BufferedInputStream *bufferedInputStream;<br /><br />std::<span style="color: #000000;">string</span> hostServer; <span style="color: #B900B9;">//149.99.39.146</span><br />int hostPort; <span style="color: #B900B9;">//50030</span><br />int socketTimeout;<br /><br />bool connected;<br /><br />FileWriter *s;<br /><br />Charset *charset;<br />CharsetDecoder *decoder;<br />CharsetEncoder *encoder;<br /><br />TcpClientUtil<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br />TcpClientUtil<span style="color: #000000;">&#40;</span>const std::<span style="color: #000000;">string</span> &HostServer, int HostPort, int SocketTimeout<span style="color: #000000;">&#41;</span>;<br /><br />virtual FileWriter *getLogger<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br />virtual void setLogger<span style="color: #000000;">&#40;</span>FileWriter *s<span style="color: #000000;">&#41;</span>;<br /><br />virtual bool ConnectSocket<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #00C800;">private</span>:<br /><span style="color: #000000;">bool</span> DisconnectSocket<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #00C800;">public</span>:<br /><span style="color: #000000;">virtual</span> std::<span style="color: #000000;">string</span> SendRequest<span style="color: #000000;">&#40;</span>const std::<span style="color: #000000;">string</span> &dataPacket<span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #00C800;">private</span>:<br /><span style="color: #000000;">char</span> *getDataPacket<span style="color: #000000;">&#40;</span>const std::<span style="color: #000000;">string</span> &data<span style="color: #000000;">&#41;</span>;<br /><br />char *concat<span style="color: #000000;">&#40;</span>char bs1<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span>, char bs2<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;<br /><br />std::<span style="color: #000000;">string</span> DecodeDataPacket<span style="color: #000000;">&#40;</span>char bs<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #00C800;">private</span>:<br />    void InitializeInstanceFields<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span>;<br /><br /><span style="color: #B900B9;">// CODE 2-----------------------------------------------------------------------------</span><br /><span style="color: #B900B9;">//JAVA TO C++ CONVERTER TODO TASK: The following line could not be converted:</span><br /><span style="color: #00C800;">private</span> boolean printTags<span style="color: #000000;">&#40;</span>String dataPacket, String hostName<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br /><span style="color: #00C800;">public</span>:<br /><span style="color: #000000;">bool</span> result;<br /><br /><span style="color: #00C800;">try</span><br /><span style="color: #000000;">&#123;</span><br /><br /><span style="color: #B900B9;">//Connect to Server </span><br />TcpClientUtil *<span style="color: #0000ff;">printer</span> = <span style="color: #00C800;">new</span> TcpClientUtil<span style="color: #000000;">&#40;</span>hostName, static_cast<int><span style="color: #000000;">&#40;</span>printerport<span style="color: #000000;">&#41;</span>, static_cast<int><span style="color: #000000;">&#40;</span>printerconnectiontimeout<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><br />bool connected = printer->ConnectSocket<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>connected == <span style="color: #00C800;">true</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><span style="color: #B900B9;">//JAVA TO C++ CONVERTER TODO TASK: There is no native C++ equivalent to 'toString':</span><br />logger::<span style="color: #000000;">info</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.toString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" : Connected To Printer.<span style="color: #000000;">\r</span><span style="color: #000000;">\n</span>"</span><span style="color: #000000;">&#41;</span>;<br /><br />std::<span style="color: #000000;">string</span> response = printer->SendRequest<span style="color: #000000;">&#40;</span>dataPacket<span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">true</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #000000;">&#125;</span><br />catch <span style="color: #000000;">&#40;</span>Exception *ex<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br /><br /><span style="color: #B900B9;">//JAVA TO C++ CONVERTER TODO TASK: There is no native C++ equivalent to 'toString':</span><br />logger::<span style="color: #000000;">info</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.toString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" : "</span> + ex->getMessage<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">false</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">return</span> result;<br /><br /><span style="color: #000000;">&#125;</span><br /> </div>[/code:e5cj5egs] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Convert PDF to EMF
Searching on the internet , i doesn't find a good tool. What is the easyst way ? Frank
Convert PDF to EMF
Maybe have a look at : <!-- m --><a class="postlink" href="http://www.pdfill.com/pdftool_pdf_to_images.html">http://www.pdfill.com/pdftool_pdf_to_images.html</a><!-- m --> Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Convert PDF to EMF
<!-- m --><a class="postlink" href="http://www.pdfmachine.com/#!products">http://www.pdfmachine.com/#!products</a><!-- m -->
Convert PDF to EMF
[quote="ukoenig":2px71p6r]Maybe have a look at : <!-- m --><a class="postlink" href="http://www.pdfill.com/pdftool_pdf_to_images.html">http://www.pdfill.com/pdftool_pdf_to_images.html</a><!-- m --> Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->[/quote:2px71p6r] Uwe , Thanks , very good utility Frank
Convert RC dialog to WebForm
Hi, Is there a tool that convert a dialog saved in a RC file to a web form ? Thanks for answer , Philippe
Convert RC dialog to WebForm
Hello Philippe, How involved are your screens and how many do you have to convert. Best regards, Otto
Convert Real to Scientific Format
Hello, I have to convert a numeric to a scientific notation , How to ?? Any function ? 10000 ==> 1,E+04 Thanks
Convert Real to Scientific Format
Method-1 [code=fw:5h1btl3s]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> N2E<span style="color: #000000;">&#40;</span> nNum, nDec <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> e := <span style="color: #000000;">0</span>, cRet<br /><br />   <span style="color: #00C800;">DEFAULT</span> nDec := <span style="color: #000000;">2</span><br /><br />   <span style="color: #00C800;">if</span> nNum >= <span style="color: #000000;">10</span><br />      <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> nNum >= <span style="color: #000000;">10</span><br />         nNum  /= <span style="color: #000000;">10</span><br />         e++<br />      <span style="color: #00C800;">enddo</span><br />   elseif nNum < <span style="color: #000000;">1</span><br />      <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> nNum < <span style="color: #000000;">1</span><br />         nNum  *= <span style="color: #000000;">10</span><br />         e--<br />      <span style="color: #00C800;">enddo</span><br />   <span style="color: #00C800;">endif</span><br />   cRet  := Str<span style="color: #000000;">&#40;</span> nNum, nDec + <span style="color: #000000;">2</span>, nDec <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" E "</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> e >= <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"+"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> e <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> cRet<br /> </div>[/code:5h1btl3s] Method-2 [code=fw:5h1btl3s]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> N2E<span style="color: #000000;">&#40;</span> nNum, nDec <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> e := <span style="color: #000000;">0</span>, cRet<br /><br />   <span style="color: #00C800;">DEFAULT</span> nDec := <span style="color: #000000;">2</span><br /><br />   e     := Floor<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Log10</span><span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   nNum  *= <span style="color: #000000;">10</span> ^ <span style="color: #000000;">&#40;</span> -e <span style="color: #000000;">&#41;</span><br /><br />   cRet  := Str<span style="color: #000000;">&#40;</span> nNum, nDec + <span style="color: #000000;">2</span>, nDec <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" E "</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> e >= <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"+"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> e <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> cRet<br /> </div>[/code:5h1btl3s] I personally like the approach in the second function. But I am not sure which is faster. Also [code=fw:5h1btl3s]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> N2E<span style="color: #000000;">&#40;</span> nNum, nDec <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> e := <span style="color: #000000;">0</span>, nLog, cRet<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nDec := <span style="color: #000000;">2</span><br /><br />&nbsp; &nbsp;nLog &nbsp;:= <span style="color: #0000ff;">Log10</span><span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;e &nbsp; &nbsp; := Floor<span style="color: #000000;">&#40;</span> nLog <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nNum &nbsp;:= <span style="color: #000000;">10</span> ^ <span style="color: #000000;">&#40;</span> nLog - e <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cRet &nbsp;:= Str<span style="color: #000000;">&#40;</span> nNum, nDec + <span style="color: #000000;">2</span>, nDec <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" E "</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> e >= <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"+"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> e <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> cRet<br />&nbsp;</div>[/code:5h1btl3s]
Convert Real to Scientific Format
One more way: [code=fw:1yemin23]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> N2SCI<span style="color: #000000;">&#40;</span> nNum, nDec <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> e &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAt, cRet<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nDec := <span style="color: #000000;">2</span><br /><br />&nbsp; &nbsp;cRet &nbsp; &nbsp; := LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum >= <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; nAt &nbsp; := <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"."</span>, cRet + <span style="color: #ff0000;">"."</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; e &nbsp; &nbsp; := nAt - <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; cRet &nbsp;:= <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cRet, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"."</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cRet, <span style="color: #000000;">2</span>, nAt - <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cRet, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cRet &nbsp;:= LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> Val<span style="color: #000000;">&#40;</span> cRet <span style="color: #000000;">&#41;</span>, nDec + <span style="color: #000000;">2</span>, nDec <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cRet &nbsp;+= <span style="color: #ff0000;">" E +"</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> e <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;elseif nNum < <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; nAt &nbsp; := <span style="color: #000000;">3</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cRet, nAt, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'0'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nAt++<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp; &nbsp; e &nbsp; &nbsp; := nAt - <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; cRet &nbsp;:= <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cRet, nAt, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"."</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cRet, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cRet &nbsp;:= LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> Val<span style="color: #000000;">&#40;</span> cRet <span style="color: #000000;">&#41;</span>, nDec + <span style="color: #000000;">2</span>, nDec <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cRet &nbsp;+= <span style="color: #ff0000;">" E -"</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> e <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; cRet &nbsp;:= Str<span style="color: #000000;">&#40;</span> nNum, nDec + <span style="color: #000000;">2</span>, nDec <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" E +0"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cRet<br />&nbsp;</div>[/code:1yemin23] We can compare performance of the above functions and choose the fastest.
Convert Real to Scientific Format
Try also this sample using C language: [code=fw:1mvrj7wq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; ? N2E<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10000</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> N2E <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; char Buf<span style="color: #000000;">&#91;</span> <span style="color: #000000;">100</span> <span style="color: #000000;">&#93;</span>;<br /><br />&nbsp; &nbsp; sprintf<span style="color: #000000;">&#40;</span> Buf, <span style="color: #ff0000;">"%E"</span>, hb_parnd<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; hb_retc<span style="color: #000000;">&#40;</span> Buf <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:1mvrj7wq] EMG
Convert Real to Scientific Format
Mr Enrico Excellent idea !!!
Convert Real to Scientific Format
Thanks for this feed back .
Convert Strings to and from UTF8 byte arrays ...
Hello to all members, is there any way to convert this Java code to FWH (getBytes method): [code=fw:2u3bhpih]<div class="fw" id="{CB}" style="font-family: monospace;">*<br />*<br />*<br /><span style="color: #00C800;">protected</span> <span style="color: #00C800;">static</span> byte<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> getTest<span style="color: #000000;">&#40;</span>String httpMethod, String methodUri, String username, String password<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />String str = httpMethod + <span style="color: #ff0000;">"<span style="color: #000000;">\n</span>"</span> + methodUri + <span style="color: #ff0000;">"<span style="color: #000000;">\n</span>"</span> + username + <span style="color: #ff0000;">"<span style="color: #000000;">\n</span>"</span> + password;<br /><br /><span style="color: #00C800;">return</span> str.getBytes<span style="color: #000000;">&#40;</span>UTF8<span style="color: #000000;">&#41;</span>;               <span style="color: #B900B9;">/**return byte array**/</span><br /><span style="color: #000000;">&#125;</span></div>[/code:2u3bhpih] Thanks
Convert Strings to and from UTF8 byte arrays ...
Look, [url:2hv7t59n]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=37451&p=225070&hilit=Encoding#p225070[/url:2hv7t59n] Regards.
Convert Strings to and from UTF8 byte arrays ...
Thanks João, but I think it is not applicable to my example. It is not charset convert. When I send string to Java method 'getbytes' with this charactes: cStr:="POST/eservice//batch/json/echoMyUserNamePass1234?" Result is: "[B@1db9742" // UTF8 byte array
Convert Strings to and from UTF8 byte arrays ...
Maybe, [code=fw:2yz294j0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br />REQUEST HB_CODEPAGE_PTISO<br /><br />REQUEST HB_CODEPAGE_PT850<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cStr, cAsc, cUtf8<br /><br />&nbsp; &nbsp;HB_SETCODEPAGE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PT850"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cStr &nbsp;:= <span style="color: #ff0000;">"Isto é um teste de conversão."</span><br /><br />&nbsp; &nbsp;cUtf8 := hb_strToUTF8<span style="color: #000000;">&#40;</span> cStr <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cAsc &nbsp;:= hb_UTF8ToStr<span style="color: #000000;">&#40;</span> cUtf8 <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? cStr<br /><br />&nbsp; &nbsp;? cUtf8<br /><br />&nbsp; &nbsp;? cAsc<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:2yz294j0] Regards, saludos. 
Convert Strings to and from UTF8 byte arrays ...
[url:7l87u4l4]http&#58;//harbourlanguage&#46;blogspot&#46;com/2010/06/harbour-codepage&#46;html[/url:7l87u4l4] [url:7l87u4l4]http&#58;//www&#46;pctoledo&#46;com&#46;br/forum/viewtopic&#46;php?f=4&t=19317[/url:7l87u4l4] [url:7l87u4l4]http&#58;//www&#46;pctoledo&#46;com&#46;br/forum/viewtopic&#46;php?f=4&t=18751[/url:7l87u4l4] [url:7l87u4l4]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=32514&start=0[/url:7l87u4l4] Regards.
Convert Strings to and from UTF8 byte arrays ...
Java method getbytes returns aray of character codes from string („ABCD“ -> {65,66,67,68}). I tried to rewrite several pages of code without previous knowledge of Java, but it was much simpler writing this part of code in FiveWin.
Convert Word to PDF in batch mode
I want to convert word documents to pdf with command line.Something like :waitrun(applicationfile.exe c:\data\doc1.doc c:\data\doc1.pdf)Only in batch, no action from the user .Thanks
Convert a print to Rtf or doc
Enrico, You need to create a WORD document in parallel. The question then is whether you should use WORD as a preview. If you want to convert a FW report, you must build the WORD document in any case. However, by manipulating the document.xml, you can use WORD as a report generator. You create your report in WORD and insert your own placeholders. We use [NAME] [etc] which is only necessary once when creating the template. When you then run a report, you replace the placeholders with the values. But I can only recommend switching to HTML right away. Best regards, Otto
Convert a print to Rtf or doc
[quote="Otto":2ljacc9x]Hello Marco, This is how we do it: <!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=13495&p=69231&hilit=word+zip&sid=62c130be6eb450bc2a0aad7749c99f80#p69231">viewtopic.php?f=3&t=13495&p=69231&hilit=word+zip&sid=62c130be6eb450bc2a0aad7749c99f80#p69231</a><!-- l --> A DOCX file is essentially a ZIP file, and inside it, there's an XML file which is, in practice, a pure text file.[/quote:2ljacc9x] The problem is not just to produce a docx file but to save a print preview as editable Word file.
Convert a print to Rtf or doc
Hi Enrico, Have you read the link? As far as I remember, I explained everything there. The XML file inside the DOCX is for that. Best regards, Otto
Convert a print to Rtf or doc
And where do you get the XML file?
Convert a print to Rtf or doc
DOCX-Format [quote:1rd0pefc] The DOCX format is an XML-based file format for Word documents, used by Microsoft Word, especially since Word 2007. It replaces the older binary DOC format. DOCX files are actually ZIP archives containing multiple files and folders that collectively represent the entire document. One key file within a DOCX archive is word/document.xml. This XML file contains the actual text of the document, along with information about its structure and formatting. The content of word/document.xml is written in a special markup language called WordprocessingML, designed for representing Word documents. In word/document.xml, you will find: Text Content: The actual text of the document, including paragraphs, headings, etc. Formatting: Information about fonts, colors, alignment, paragraph formats, list formats, etc. Structure: Tags defining the document's structure, such as section headings, footnotes, endnotes, margin notes, etc. Elements like Tables and Images: References to other files in the DOCX archive that contain images, tables, and other non-text elements. Special Tags: These are used to represent special features like tables of contents, hyperlinks, embedded objects, etc. To view the contents of word/document.xml, you can open a DOCX file with an archiving program like WinRAR or 7-Zip, and then view the word/document.xml file with a text editor or an XML viewer. Knowledge of XML is helpful to understand the content and structure of this file. [/quote:1rd0pefc]