| (https://forum.dhammacitta.org/proxy.php?request=http%3A%2F%2Fmedia.bigoo.ws%2Fcontent%2Fgif%2Fgirl%2Fgirls_27.gif&hash=ff35c216f0daf4c5154fc409030ab10778a6cd5d) | Mencari kesalahan dlm program seperti mencari pembunuh. Banyak sebab yg tak terduga, dan kadang kala kita membutuhkan bantuan orang lain. Moga2 dgn topic ini, pembunuhan tsb cepat ketangkap!.... :)) :)) dan anda kembali bisa tidur nyenyak ;D ;D ;D |
local lcTempFile, lcPrinterName, lcFileInRam
SET SAFETY OFF
lcTempFile = 'c:\coba.txt'
lcPrinterName = SET("Printer",2) &&
SET PRINTER TO NAME (lcPrinterName) &&
SET DEVICE TO FILE (lcTempFile)
[at] PROW(),10 SAY ALLTRIM(CUST_ID)
[at] PROW(),43 SAY ALLTRIM(PENERIMA)
[at] PROW()+1,3 SAY ALLTRIM(PENGIRIM)
[at] PROW()+1,3 SAY ALLTRIM(alam1)
[at] PROW()+1,3 SAY ALLTRIM(alam2)
[at] PROW()+1,0 say ' ' &&biar posisi head printer kembali ke posisi 0(nol)
[at] PROW()+01,0 say " "
Quote from: Indra on 24 August 2009, 02:16:21 PM
Bro Johan,
coba anda buat custom paper size dengan cara
Start->Printer and Faxes->pada menu (di bagias atas) click File->Server Properties
setelah anda mendefinisikan jenis paper ini, kemudian pilih paper jenis ini saat print, pasti beres.
Quote from: johan3000 on 25 August 2009, 07:57:33 AMQuote from: Indra on 24 August 2009, 02:16:21 PM
Bro Johan,
coba anda buat custom paper size dengan cara
Start->Printer and Faxes->pada menu (di bagias atas) click File->Server Properties
setelah anda mendefinisikan jenis paper ini, kemudian pilih paper jenis ini saat print, pasti beres.
Thanks bro Indra atas masukannya, tetapi printer driver LX-300+ bawaan window XP tsb
tidak menyediakan CUSTOM SIZE, sedangkan kalau ganti printer inkJet baru seharusnya gak masalah. Tapi pelanggan mendengar BELI, BELI, BELI,... udah gak mau.
sharing : Dokumentasi/backup sangalah penting dalam dunia software developer.
seingat saya dulu juga begitu printernya di pasang gak bisa langsung mulus. Jadi saya coba beberapa driver (bisa juga download dari internet), dan akhirnya bisa. Sayangnya kejadian tsb tidak didokumentasikan dgn baik dan driver (LX-300+) yg bisa itu tidak dicopy dan disimpan, jadilah setelah sekian tahun udah gak ingat DULU BISA, DGN CARA GIMANA ?
Udah juga dicoba pilih amplot size yg lain2 dan belum berhasil.
thanks again, bro Indra udah membantu.
_/\_
Quote from: Forte on 24 August 2009, 03:40:59 PM
try this..Code (visual foxpro) Select
local lcTempFile, lcPrinterName, lcFileInRam
SET SAFETY OFF
lcTempFile = 'c:\coba.txt'
lcPrinterName = SET("Printer",2) &&
SET PRINTER TO NAME (lcPrinterName) &&
SET DEVICE TO FILE (lcTempFile)
[at] PROW(),10 SAY ALLTRIM(CUST_ID)
[at] PROW(),43 SAY ALLTRIM(PENERIMA)
[at] PROW()+1,3 SAY ALLTRIM(PENGIRIM)
[at] PROW()+1,3 SAY ALLTRIM(alam1)
[at] PROW()+1,3 SAY ALLTRIM(alam2)
[at] PROW()+1,0 say ' ' &&biar posisi head printer kembali ke posisi 0(nol)
itu hasil google..
kelemahannya, yaitu gak bisa huruf besar, tapi bisa diakali.. dengan kombinasi kunci pada LX-300
nanti malam coba gw cari dan gw share.. mudah2an masih ada di lappie
QuoteCreating Reports
Standard wisdom suggests creating a report and adding tables to its data environment and setting relations among them, then dragging the controls onto the report, much as you created your frmData form. While this approach is easy to begin with, it can create a debugging nightmare for multi-table reports. In truth, the simplest way to create a report begins with an SQL SELECT statement, and once you've learned a little of this "second" programming language, it's easier to type the SQL code than to use a Wizard or GUI interface.
To make best use of the FoxPro report writer, use SQL to create a denormalized view or cursor of the exact data you want in your report. Refer to the fields in the cursor as MyField only and not MyCursor.MyField. The Report Writer will run the report from whatever cursor, table, or view is in the currently selected work area. The extra effort of adding the controls to the report individually is well worth the time in exchange for the ease of getting the rest of the report working properly.
(https://forum.dhammacitta.org/proxy.php?request=http%3A%2F%2Fwww.melbpc.org.au%2Fpcupdate%2F2108%2F2108article4-9.gif&hash=c6f7b8955e87d3bbc9a463b95ab10e27da9f04b2) Figure 9. The most foolproof way to create reports in Visual FoxPro is to select with SQL commands, exactly the way you want it to appear in your report. This code can be
located in the Click() method of the button that calls the
report, and is usually followed by the REPORT command.Figure 9. The most foolproof way to create reports in Visual FoxPro is to select with SQL commands, exactly the way
you want it to appear in your report. This code can be
located in the Click() method of the button that calls the
report, and is usually followed by the REPORT command.(https://forum.dhammacitta.org/proxy.php?request=http%3A%2F%2Fwww.melbpc.org.au%2Fpcupdate%2F2108%2F2108article4-10.gif&hash=3a6f58ffe360a1506bc58c60c105e1060bcb6d9c) Figure 10. Adding fields to a report is as simple as drawing a rectangle, then typing in the name of the field which you want shown in that position. The Visual FoxPro Report Writer easily does group and summary totals, averages, and so on, and with a few Print When tricks can produce some very sophisticated reports.
Create a frmReport with a "Run Report" button. Double click on the "Run Report" button on your frmReport and type the following code in the window, as shown in Figure 9:
SELECT * FROM Customers ;
INTO CURSOR TempCustomers ;
ORDER BY Customer
REPORT FORM Customers.FRX TO PRINTER PROMPT PREVIEW
Create a new report by highlighting Reports on the Docs tab of the Project Manager and clicking New. Save your report as "Customers." Using the Report Controls toolbar, click the Field control and draw a rectangle in the detail section of the report as shown in Figure 10. Type "Customer" in the Expression textbox. You can add other fields, and finish off the title band if you want. The Visual FoxPro Report Writer has many other capabilities including group and summary computations that I'll leave for you to discover. Getting the most out of the Report Writer is mostly a matter of assembling the data in the order and way you want it to appear, and learning a few tricks with Print When and formatting.
http://www.melbpc.org.au/pcupdate/2108/2108article4.htm
Quote from: hatRed on 25 August 2009, 08:59:08 AM
[at] om jo
itu PRG sama FRM apa sih?
Quote from: hatRed on 25 August 2009, 08:44:03 AM
kalo gak salah itu untuk ukuran2 kertas di windows...
kalo buat c90 tergantung neh.. print lewat kodeprogram atau pake aplikasi printer c90..
tapi bukannya ngeprint di lx-300 ???
Quote
TATCommandDevice = class(TObject)
public
constructor Create(const AName: String = '');
end;
TATModem = class(TATCommandDevice)
public
constructor Create(const AName: String = ''); override;
end;
Error: there is no method in an accesstor class to be overriden: "constructor TATModem.Create(const AnsiString);"
Quote from: tesla on 21 December 2010, 02:37:32 PM
gan... nanya donk... kok yg ini ga bisa di compile ya?
error di compilenya:Code Select
Error: there is no method in an accesstor class to be overriden: "constructor TATModem.Create(const AnsiString);"
padahal kan di ancestornya ada tuh method...
kenapa yah gan?
QuoteVirtual and dynamic methods
To make a method virtual or dynamic, include the virtual or dynamic directive in its declaration. Virtual and dynamic methods, unlike static methods, can be overridden in descendant classes. When an overridden method is called, the actual (runtime) type of the class or object used in the method call--not the declared type of the variable--determines which implementation to activate.
To override a method, redeclare it with the override directive. An override declaration must match the ancestor declaration in the order and type of its parameters and in its result type (if any).
In the following example, the Draw method declared in TFigure is overridden in two descendant classes.Code Selecttype
TFigure = class
procedure Draw; virtual;
end;
TRectangle = class(TFigure)
procedure Draw; override;
end;
TEllipse = class(TFigure)
procedure Draw; override;
end;
Given these declarations, the following code illustrates the effect of calling a virtual method through a variable whose actual type varies at runtime.Code Selectvar
Figure: TFigure;
begin
Figure := TRectangle.Create;
Figure.Draw; // calls TRectangle.Draw
Figure.Destroy;
Figure := TEllipse.Create;
Figure.Draw; // calls TEllipse.Draw
Figure.Destroy;
end;
Only virtual and dynamic methods can be overridden. All methods, however, can be overloaded; see Overloading methods.
Virtual versus dynamic
Virtual and dynamic methods are semantically equivalent. They differ only in the implementation of method-call dispatching at runtime. Virtual methods optimize for speed, while dynamic methods optimize for code size.
In general, virtual methods are the most efficient way to implement polymorphic behavior. Dynamic methods are useful when a base class declares many overridable methods which are inherited by many descendant classes in an application, but only occasionally overridden.
Note:
Only use dynamic methods if there is a clear, observable benefit. Generally, use virtual methods.
QuoteOverriding methods
Overriding a method means extending or refining it, rather than replacing it. A descendant class can override any of its inherited virtual methods.
To override a method in a descendant class, add the directive override to the end of the method declaration.
Overriding a method causes a compilation error if
* The method does not exist in the ancestor class.
* The ancestor's method of that name is static.
* The declarations are not otherwise identical (number and type of arguments parameters differ).
Quote from: Indra on 22 December 2010, 12:55:43 PM
sebelumnya saya termasuk orang yg fanatik sama delphi.
tapi sekarang trend programming sudah mengarah kepada open source dan cross platform, sedangkan delphi masih nempel sama M$. Delphi XE yg terbaru, juga masih belum mengusung cross platform yg sangat ditunggu2 oleh para delepoper seluruh dunia. hal ini membuat delphi jadi tidak populer. alternatif pengganti delphi adalah lazarus. tapi lazarus tumbuh terlalu lambat, tidak mampu mengejar ketinggalan.
Quote from: tesla on 22 December 2010, 01:19:31 PM
gw suka Delphi karena hasil compilenya stand alone. jadi hasil compiled nya ga tergantung lagi dg library lain --- di platform M$ Windows tentunya.
secara default, semua library yg dibutuhkan ter-static linking dg application binary, yet file & memory usage sizenya masih kecil.
utk Desktop programming, saya cuma ketemu Delphi & sodaranya C Builder, IDE yg begini... cmiiw
skr saya pakai Lazarus karena... (Anda benar) 1. cross platform (tp harus direcompile). 2. IDE nya tidak memakan resource seganas Delphi (Delphi yg support Unicode tentunya... jgn bandingkan dg Delphi 7 ke bawah).
utk Lazarus, ada 1 fitur yg sangat keren menurut saya. yaitu pemilihan widgets utk GUI, programmer ga perlu pusing lagi dg lib2 widgets, tanggung jawab ini menjadi tanggung jawab tools nya (Lazarus). saya suka sekali fitur ini...
utk aplikasi web dan device, kayanya memang bukan bidang Lazarus... malah menurut saya Delphi tidak focus krn merambah ke framework2 microsoft... jadi saya rasa sih Lazarus udah cukup mature dan mungkin akan menjadi tonggak hidupnya Pascal mengambil alih dari tangan Delphi (harapan pribadi jg sih...). jika dilihat dari websitenya, imho perkembangan Lazarus sangat aktif.
(https://forum.dhammacitta.org/proxy.php?request=http%3A%2F%2Fwww.freepascal.org%2Fpic%2Flogo.gif&hash=afebc007c636018686e5a1e77cb3be38e1730160)
tuh lihat... bener kan kata saya... sangat aktif... lari terus, ga capek2 ;D
Quote from: Indra on 22 December 2010, 01:23:22 PMutk desktop kayanya java (Swing) performance nya loyo deh... suruh nunggu minum kopi dulu utk starting :P
saya juga berharap demikian, senangnya kalau bisa terus berbicara dalam bahasa Pascal. bahasa yg sangat estetis menurut saya, tidak seperti bahasa JAWA, walaupun akhirnya saya terpaksa harus berbicara JAWA juga ;D
Quote from: tesla on 22 December 2010, 10:00:40 AMmaksudnya banyak penambahan belakangan seperti reintroduce tadi... kalo sampe bisa override ancestor class berarti mangkin susah ditrace dan dibaca, padahal tujuan utama pascal adalah readability dan diutamakan untuk kalangan akademik yg ingin belajar programming.
pascal hancur gmn?
delphi terjun bebas gmn?
... Lazarus itu kan meniru Delphi... kalau Delphi udah uzur, Lazarus ikut?
Quote from: morpheus on 22 December 2010, 05:07:04 PM
maksudnya banyak penambahan belakangan seperti reintroduce tadi... kalo sampe bisa override ancestor class berarti mangkin susah ditrace dan dibaca, padahal tujuan utama pascal adalah readability dan diutamakan untuk kalangan akademik yg ingin belajar programming.
pencipta pascal (wirth) pernah mengeluh hal yg sama, setelah pascal ditambahin ini itu sama borland. pascal tidak lagi murni, malah mulai membentuk sekte2 baru dengan penambahan ajaran2 non-otentik ke dalam kitab suci pascalitaka... mungkin ini adalah upaya kausalya.
var holder: ^TParent;
holder := [at] achildInstance;
^holder.doSomething;
Quote
Suppose you developed an awesome framework using language X and released it as version 1. Your users raved at all it could do and it became heavily used. Flush with success, you decide to release version 2 with even more awesomeness. You specifically made sure it was fully backward compatible. Suddenly, you users started reporting strange behaviors. Their own virtual methods were being called at strange times. Many reported that their old code would not compile with the new version. Strange. All the same objects, methods, and functionality still remained. All you did was add a few virtual methods to some base classes, some new object types, and some new optional functionality. What happened?
The override and reintroduce directives serve to eliminate this problem by requiring that in order to actually override a virtual method you must use the override directive in place of the virtual directive. If you happen to introduce your own virtual method that has the same name as one of your ancestors' virtual methods, the compiler now warns you, but will still do the right thing. In this case, using reintroduce, not only suppresses that warning, it also serves to document in the source you intended to do that.
Without the override and reintroduce directives, you would not be able to continually evolve your framework without fear of breaking all your users. And if your users had to make massive modifications every time a new version is released, then they would be loathe to adopt the new version. Finally, using "override" also allows the framework designer to change the type of virtual in the ancestors without breaking user code. For instance, in Delphi many methods are marked "dynamic" which is a table-based runtime method lookup form of polymorphism. It's doesn't perform quite as fast as a regular virtual so it is usually used for methods that are rarely overridden and/or are responses to user actions where the extra overhead is never noticed. Suppose in V1 of the framework a method was marked "dynamic" but in practice it ended up being overridden and called more than you intended. In V2, you could change it to "virtual" without fear of user's code being broken.
Delphi's Object Pascal language isn't the only language to recognize this problem. C# requires the use of an "override" directive for the exact same reason. The C++ standards committee is finally recognizing the problem and are modifying the language to support it... sort of. In C++, if a method's name and parameter list matches an ancestor's virtual, then it is an override (even if you don't say "virtual" on the descendant!). For the upcoming new C++ standard, if you specify "virtual" and the signatures don't match then it is a new virtual method introduced on current class. If there is a signature match with the ancestor and the writer didn't intend to override, then the "new" keyword is used to tell the compiler that this is a new virtual for this class.
Quote
If you declare a method in a descendant class that has the same name as a method in an ancestor class then you are hiding that ancestor method - meaning if you have an instance of that descendant class (that is referenced as that class) then you will not get the behavior of the ancestor. The compiler will give you a warning.
Now you have one of two choices to suppress that warning message:
Adding the keyword reintroduce just lets the compiler know you are hiding that method and it suppresses the warning. You can still use the inherited keyword within your implementation of that descended method to call the ancestor method.
If the ancestor's method was virtual or dynamic then you can use override. It has the added behavior that if this descendant class is cast back as the ancestor, then the call to that method will always be to the descendant method (which then may optionally call the ancestor through inherited).
So difference between override and reintroduce is in polymorphism. With reintroduce, if you cast the descendant class as the parent, then call that method you will get the ancestor method, but if you have it cast as the descendant method then you will get the behavior of the descendant. With override you always get the descendant If the ancestor method was neither virtual nor dynamic, then reintroduce is your only option (actually you could use a class helper, but we won't go there now).
In spite of what Malach said, you can still call inherited on a reintroduced method, even if the parent was neither virtual nor dynamic.
Essentially reintroduce is just like override, but it works with non-dynamic and non-virtual methods, and it does not replace the behavior if the object instance is cast back as the ancestor.
Further Explanation:
Reintroduce is a way of communicating intent to the compiler that you did not make an error. The traditional way of overriding a method in an ancestor is with the override keyword, but it requires that the ancestor method was virtual or dynamic, and that you want the behavior to change when the class is cast as the ancestor class. Now enter finalize. It lets you tell the compiler that you did not accidentally create a method with the same name as an ancestor method (which would be annoying if the compiler didn't warn you about) and this allows you to override a method that is not virtual or dynamic or if you don't want the behavior changed when the class is cast as the ancestor.
Quote from: Indra on 22 December 2010, 12:55:43 PM
sebelumnya saya termasuk orang yg fanatik sama delphi.
tapi sekarang trend programming sudah mengarah kepada open source dan cross platform, sedangkan delphi masih nempel sama M$. Delphi XE yg terbaru, juga masih belum mengusung cross platform yg sangat ditunggu2 oleh para delepoper seluruh dunia. hal ini membuat delphi jadi tidak populer. alternatif pengganti delphi adalah lazarus. tapi lazarus tumbuh terlalu lambat, tidak mampu mengejar ketinggalan.
Quote from: seniya on 22 December 2010, 07:14:31 PM
Bukannya ada Kylix, versi cross platform dari Delphi????
Quote from: Indra on 22 December 2010, 05:53:29 PMoh, kirain mengganti code yg ada di parent ala ruby.
Essentially reintroduce is just like override, but it works with non-dynamic and non-virtual methods, and it does not replace the behavior if the object instance is cast back as the ancestor.