-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postsplit sample data & header file(0)
 by andtho89
 on 23.May at 08:49
goto Postpemanggilan frame(5)
 by andtho89
 on 23.May at 02:13
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 4 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 4 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
irosyidiOffline
Location:
Post subject: [ask] buat funtion dengan nilai return berupa record  PostPosted: 02/Feb/2012 11:29
onKnowledgeable


Joined: 07-Aug-2006
Posts: 142

Status: Offline
Help mastah delphi..
saya punya msalah tentang funtion..
ini code sample nya
code : pascal
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7. Dialogs, StdCtrls;
  8.  
  9. type
  10. TForm1 = class(TForm)
  11. Button1: TButton;
  12. procedure Button1Click(Sender: TObject);
  13. private
  14. { Private declarations }
  15. public
  16. { Public declarations }
  17. end;
  18.  
  19. type TBarang = record
  20. id, nama :string
  21. end;
  22.  
  23. var
  24. Form1: TForm1;
  25. barang : TBarang;
  26.  
  27. implementation
  28.  
  29. {$R *.dfm}
  30.  
  31. function MyBarang(id,nama:string):TBarang;
  32. begin
  33. barang.id := id;
  34. barang.nama := nama;
  35. end;
  36.  
  37. procedure TForm1.Button1Click(Sender: TObject);
  38. var
  39. p:TBarang;
  40. begin
  41. p:= MyBarang('001','Sepatu');
  42. ShowMessage(p.nama);
  43. end;
  44.  
  45. end.
Parsed in 0.005 seconds, using GeSHi


waktu tombol di pencet kok messagebox nya kosong?
ada yang salahkah dengan kode saya?

tengkyu
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
GoenOffline
Location: Jakarta
Post subject: Re: [ask] buat funtion dengan nilai return berupa record  PostPosted: 07/Feb/2012 10:50
onIntermediate


Joined: 28-Mar-2006
Posts: 32
Location: Jakarta
Status: Offline
Bro,

Kurang return value-nya.

code : pascal
  1. function MyBarang(id,nama:string):TBarang;
  2. begin
  3. barang.id := id;
  4. barang.nama := nama;
  5. Result := barang; // Function seharusnya punya return value.
  6. end;
Parsed in 0.001 seconds, using GeSHi
 
 View user's profile Send private message  
Reply with quote Back to top
mas_kofa
Location: New York Arto
Post subject:   PostPosted: 07/Feb/2012 22:37
onElite


Joined: 18-Mar-2006
Posts: 1753
Location: New York Arto
kalo diliat dari koding nya....function rancu.......Wink)

_________________
Pay Per Day | Pesbuk
Me isn't mine
Aku Ini adalah satu

Cerdik seperti ular, Tulus seperti merpati
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits


| Register | Lost Password ? |