Arsip: tanya ubah tipe data
more 12 years ago
diandewi
halo para master, saya mau tanya, gimana ya caranya ngubah tipe data Pmatrix jadi string?
ini coding saya:
writeln(f, 'Input jst:');
for i:=1 to N do
begin
for j:=1 to N do
Write(f,PJst^[i]^[j],' ');
//input [i,j]:= (PJst^[i]^[j]);
writeln(f);
tipe data:
PJst: Pmatrix;
input: array of string;
tapi errornya yang keluar kyk gini:
[DCC Error] Pca.pas(252): E2010 Incompatible types: 'Char' and 'Double'
saya juga mau nampilin variabel pjst pke show message jd saya harus ubah tipe data pjst itu jd string.
caranya gmn ya? mohon bantuannya
more 12 years ago
Dookie
@diandewi: halo para master, saya mau tanya, gimana ya caranya ngubah tipe data Pmatrix jadi string? ini coding saya: writeln(f, 'Input jst:'); for i:=1 to N do begin for j:=1 to N do Write(f,PJst^[i]^[j],' '); //input [i,j]:= (PJst^[i]^[j]); writeln(f); tipe data: PJst: Pmatrix; input: array of string; tapi errornya yang keluar kyk gini: [DCC Error] Pca.pas(252): E2010 Incompatible types: 'Char' and 'Double' saya juga mau nampilin variabel pjst pke show message jd saya harus ubah tipe data pjst itu jd string. caranya gmn ya? mohon bantuannyaPmatrix merupakan type pointer kalau dilihat dari penambahan P didepannya, perhatikan yg dicetak bold Write(f,PJst^[i]^[j],' ');...nah yg jadi masalah deklarasi Pmatrix-nya mana? dari contoh diatas ga keliatan sama sekali, klo diliat dari error-nya tipe dari pointer PMatrix adalah float sedangkan inputnya char
more 12 years ago
diandewi
owh gt.....makasi petunjuknya
saya ada masalah lg
saya mau pindahin array yang dideklarasi itu kedalam variabel w tp muncul error kyk gni:
[DCC Error] Unitlvq.pas(60): E2010 Incompatible types: 'Char' and 'string'
mohon batu untuk dkoreksi..
var
ref : array of string = (('1.00000000000000E+0000', '1.00000000000000E+0000', '1.00000000000000E+0000','1.00000000000000E+000',
'1.00000000000000E+0000','1.00000000000000E+0000', '1.00000000000000E+0000', '1.00000000000000E+0000','1.00000000000000E+000',
'1.00000000000000E+0000'),
('2.00000000000000E+0000', '2.00000000000000E+0000','2.00000000000000E+0000','2.00000000000000E+0000',
'2.00000000000000E+0000', '2.00000000000000E+0000', '2.00000000000000E+0000','2.00000000000000E+0000','2.00000000000000E+0000',
'2.00000000000000E+0000'));
w:array of string;
begin
for i := 1 to 2 do
begin
for j := 1 to Length(ref[i]) do
begin
w [i,j]:= ref[i,j];
end ;
end;
more 12 years ago
ImanD
@diandewi: owh gt.....makasi petunjuknya saya ada masalah lg saya mau pindahin array yang dideklarasi itu kedalam variabel w tp muncul error kyk gni: [DCC Error] Unitlvq.pas(60): E2010 Incompatible types: 'Char' and 'string' mohon batu untuk dkoreksi.. var ref : array of string = (('1.00000000000000E+0000', '1.00000000000000E+0000', '1.00000000000000E+0000','1.00000000000000E+000', '1.00000000000000E+0000','1.00000000000000E+0000', '1.00000000000000E+0000', '1.00000000000000E+0000','1.00000000000000E+000', '1.00000000000000E+0000'), ('2.00000000000000E+0000', '2.00000000000000E+0000','2.00000000000000E+0000','2.00000000000000E+0000', '2.00000000000000E+0000', '2.00000000000000E+0000', '2.00000000000000E+0000','2.00000000000000E+0000','2.00000000000000E+0000', '2.00000000000000E+0000')); w:array of string; begin for i := 1 to 2 do begin for j := 1 to Length(ref[i]) do begin w [i,j]:= ref[i,j]; end ; end;bisa di ganti dengan
w:array of array of string;
nanti tinggal di set arraynya
atau
paling simple nya sech ganti az data type-nya sesuai declarasi array diatas
w: array[1..2,0..9] of string;
more ...
- Pages:
- 1
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- mengambil rec dari listbox
by nurez in Tip n Trik Pemrograman more 17 years ago - nokia yg support buat sms gateway
by agso in Hal umum tentang Pascal Indonesia more 16 years ago - demo sisfo RS
by wong_error in Hal umum tentang Pascal Indonesia more 17 years ago - Select like dari Query
by riagil in MySQL more 12 years ago - cara capture form
by veanz in Hal umum tentang Pascal Indonesia more 14 years ago - scrolling navigator pada DBGrid dan pada Combobox
by Tiwul in Form Enhancement & Graphical Controls more 13 years ago - Medapatkan nama file didelphi
by mrsatan_26 in Tip n Trik Pemrograman more 14 years ago - membuat alat Input/Output via Tcomport
by Ijal_palu in Tip n Trik Pemrograman more 18 years ago - Nampilin Data2 dg jml dinamis di QReport..??
by imunk in Hal umum tentang Pascal Indonesia more 17 years ago - memproteksi port usb
by flamade in Network, Files, I/O & System more 17 years ago