Highlighted
Absent Member.
Absent Member.
2174 views

c# to acucobol

[Migrated content. Thread originally posted on 19 May 2012]

hi all,
is there anyone to help to convert that I've wrote C# codes (below) to acucobol ?
Thanks.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Xml;
using System.IO;

namespace dvzget
{
class Program
{
static void Main()
{
Console.Clear();
DataSet myDoviz = new DataSet();
myDoviz.ReadXml("http://www.tcmb.gov.tr/kurlar/today.xml");

string[] rowString = new string[myDoviz.Tables[1].Rows.Count];
int i = 0;
foreach (DataRow dr in myDoviz.Tables[1].Rows)
{
rowStringIdea = dr.ItemArray.GetValue(11).ToString() + ";";
rowStringIdea += dr.ItemArray.GetValue(1).ToString() + ";";
rowStringIdea += dr.ItemArray.GetValue(4).ToString() + ";";
rowStringIdea += dr.ItemArray.GetValue(5).ToString() + ";";
rowStringIdea += dr.ItemArray.GetValue(6).ToString() + ";";
rowStringIdea += dr.ItemArray.GetValue(7).ToString() + ";";
rowStringIdea += dr.ItemArray.GetValue(0).ToString();
i++;
}
File.WriteAllLines(@"\fortuna.700\doviz.txt", rowString);
}
}
}
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: c# to acucobol

here are cobol codes that how I used created by C# (console application)

kur-yukle.
perform internet-kontrol
if dwResult not = 1
display message box
"İnternet bağlantısı yapılamıyor, kontrol ediniz"
x"09"
title "Uyarı"
exit paragraph
end-if
************ calling dvzget.exe when internet connection is available ***********
string work-area
"dvzget.exe"
delimited by size into cmd-line
call "c$system" using cmd-line
csys-hidden
on exception
display message box
"Program bulunamadı"
title "Hata"
exit paragraph
end-call
************ preparing grid to display ************
modify doviz-grid reset-grid = 1
perform grid-baslik | header line of grid
**************************************************
*********** sdosya is created by dvzget.exe and *********
move 0 to dosya-flag |dosya-flag is control flag of doviz.txt(created or not)
open input sdosya
if dosya-flag = 1
exit paragraph
end-if
perform until 1 = 2
read sdosya next with no lock
at end
exit perform
end-read
unstring ksdosya |ksdosya is name of record of the text file
delimited by ";"
into ws-dvzkod
ws-dvzad
ws-dvzfa
ws-dvzfs
ws-dvzfae
ws-dvzfse
ws-dvzbr
end-unstring
move ws-dvzkod to grpdk d-dvzk
read grpd with no lock
invalid
initialize kgrpd |kgrpd is name of record of the exchange master file
not invalid
perform veri-convert
perform veri-tasi
end-read
end-perform
close sdosya
delete file sdosya.

veri-convert.
if cms-desimal = 0 |cms-desimal is parameter of user (desimal point is comma or not)
inspect ws-dvzfa replacing all "." by ","
inspect ws-dvzfae replacing all "." by ","
inspect ws-dvzfs replacing all "." by ","
inspect ws-dvzfse replacing all "." by ","
end-if
move ws-dvzfa to d-dvzfa convert
move ws-dvzfae to d-dvzfae convert
move ws-dvzfs to d-dvzfs convert
move ws-dvzfse to d-dvzfse convert
move ws-dvzbr to d-dvzbr convert.

veri-tasi.
move d-dvzk to list-kod
move grpdad to list-ad
move d-dvzfa to editli-goster
move editli-goster(1:xdvzfiy) to list-kura
move d-dvzfae to editli-goster
move editli-goster(1:xdvzfiy) to list-kurae
move d-dvzfs to editli-goster
move editli-goster(1:xdvzfiy) to list-kurs
move d-dvzfse to editli-goster
move editli-goster(1:xdvzfiy) to list-kurse
move d-dvzbr to list-brm
modify doviz-grid, record-to-add = list-data.

internet-kontrol.
************* internet connection check of web site *************
call "wininet.dll" on exception
display message box
"wininet.dll bulunamadı" x"09" " "
title "hata"
exit paragraph
end-call

string "http://www.tcmb.gov.tr"
low-values
delimited by size
into urlbuffer

initialize dwresult dwreserved
move 1 to dwflags
call "internetcheckconnectiona" using
by reference urlbuffer
by value dwflags
by value dwreserved
giving dwresult
cancel "wininit.dll".
0 Likes
Highlighted
Contributor.
Contributor.

RE: c# to acucobol

Merhaba, acucobol kullanan bir türk görmek güzel, kodun tamamını gönderemedin herhalde, yardimci olabilirim.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: c# to acucobol

Merhaba, bende cevabınızı şaşkınlık ve memnuniyetle okudum.
Dosya ekleyemiyorum ancak posta adresinize gönderebilirim.

Acucobol'da, C# ta olduğu gibi web sitesinden xml dosya okuyabilecek
rutin veya mekanizma olup olmadığını bilmiyorum, bu yüzden yukarıda
özet kodları olan C# console programını yazdım ve böylece kullanıcı
her an merkez bankası kurlarını alabiliyor.

C# kodunu derleme imkanınız var ise yarattığı text dosyasını görebilirsiniz,
Bende Acucobol içinden call ediyor yaratığı text dosyasını okuyup
kur datasına(vision index) yazıyorum.

Saygılarımla
Sedat
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.