Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VB.NET
Haiii all
 
I have a foxpro 2.6 dos based application, this application i want to convert into C# or VB.Net, so please help me out guys.
 

procedure save_clas_det
 
if(empty(tcur_clas))
 
  do mesg_wind with 'Incomplete Details . Please Check......'
  
  return
 
endif
 

decl temp_arr[1]
 
if(told_or_new = 1)
 
  sele 5
  seek class_arr[tclass_no,2]
  
  trec_no = recno()
 
  
  temp_arr = 0
  
  select count(*) from &tcl_det_file ;
    where name = tcur_clas .and. recno() # trec_no ;
    into array temp_arr
 

  if(temp_arr[1] > 0)
 
    do mesg_wind with 'Duplicate Entry . Please Check......'
    
    return
 
  endif
  
else
 
  temp_arr = 0
 
  select count(*) from &tcl_det_file ;
    where name = tcur_clas ;
    into array temp_arr
    
 
  if(temp_arr[1] > 0)
 
    do mesg_wind with 'Duplicate Entry . Please Check......'
    
    return
 
  endif
  
 
  sele 5
  append blank
 
 
  temp_arr = 0
 
  select max(class) from &tcl_det_file ;
    into array temp_arr
    
  repl class with temp_arr[1] + 1
  
endif
 
repl name with tcur_clas
 
if(told_or_new = 1)
 
  if(tcur_clas # substr(class_arr[tclass_no,1],3))
 
    class_arr[tclass_no,1] = space(2) + tcur_clas
    
    show gets
    
  endif
 
else
 
  do get_cl_det with .f.
 
  tcur_clas = space(tclas_name_len)
  
  show gets
  
endif
 
do mesg_wind with 'Class Details Saved......'
 

The above is the code of foxpro, there i want the 'Duplicate entry' that functionality i want, plz see the code and tell the conversion, ThnQ
 
ThnQ
Posted 19-Aug-12 7:15am
Edited 20-Aug-12 5:25am
v3
Comments
Kenneth Haugland at 20-Aug-12 7:58am
   
I personally think this would be easyer if you just tell us what you want, ProFox is not my first languange if you get my drift :)
srinu2008 at 20-Aug-12 8:08am
   
I need a logic, which the user input should be checked to database before saving to the database, i.e.,if a user give a value of "SIME1" and click save button, first the value is checked whether it is already in database or not, if found means it should raise a exception that already exists else save the value, it is nothing but duplicate value checking, Help me out, ThnQ
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You're basically writing a new app from scratch. There is no conversion path, FoxPro is long dead. So, there's nothing we can do for you, you just need to start writing a C# or VB.NET app that does what the Fox Pro app did.
  Permalink  
Comments
srinu2008 at 20-Aug-12 4:02am
   
Thnxs for your reply, as you said i had to start writing from scratch that which i don't have much experience, let me know can you help me out in this, ThnQ
Christian Graus at 20-Aug-12 6:54am
   
Well, do you know C# ? I'm not sure how I can help on such a broad question, but if you post specific questions here, we can help with those as you go through. What's your background ? Do you know C# ? How did you get this task ?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I dont think there is any convertion tools that woul dhelp you with that. Think youll have to translate the code line by line Smile | :)
  Permalink  
Comments
srinu2008 at 20-Aug-12 4:03am
   
Thanks for quick reply, I will try my best, but i was very confusion in this coding, can you help me out in this regard, ThnQ
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Easier to convert to Visual FoxPro.
  Permalink  
Comments
srinu2008 at 20-Aug-12 4:04am
   
Ya it is easier to convert to visual foxpro, but i need to convert in C# which i had to write from scratch which i don't have much experience in dealing this project right from scratch, can you help me out in this regard, ThnQ
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

HI,

We have manually converted two Applications (equivalent to re-writing) from FoxPro 2.6 to VB.Net, keeping the database in FoxPro.

If you have a similar requirement, we can work for your project, you can contact us on ssgindia@ssgindia.com

If you want to do it yourself - it is a long way to go - first to learn FoxPro commands and then learn the application Logic and then be very careful about bugs because "To err is Human" will introduce so many new bugs to the new application.

Thanks
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Well, seeing the answers from Christian Graus and from Kenneth Haugland and your answers to them I can see you need to learn the basics of any of those languages to start with.
 
You have two options here:
 
If you have the code then you will need only to learn to translate it.
 
If you don't have the code then you will have to imagine how it works and make reverse engineering to make it work as expected.
 
Being any of those previous scenarios the one you have to face, then I would start looking at the controls you will need and start looking at the articles area of CP (see "articles" (just under bob) and "chapters and sections") to find out information on how to make them work.
 
Then depending on your programming skills and background you will need to get a book to learn the basics.
 
I would try to start with that and when you get stucked come here to ask a specific question (don't ask us how to make an entire app. because we don't have enough information on that neither it's our aim to make complete systems for free).
 
Try to do it and then come back with specific questions. Never, ever press a key without having made a proper design.
 
Good luck!
  Permalink  
Comments
srinu2008 at 20-Aug-12 4:49am
   
Hai Joan, Thanks for your suggestions, i learn basics of C# but while developing apps, i am in little bit confusing, as i have foxpro code, it is completly different and i didn't know where to start
 
Anways I tried to start a module in that module the user input some value, that i placed textbox for that, but i struck up at when the user enter the same values 2 times, that should not saved and raise a exception, i.e., When a User enter some value like "SIME1" it should be checked with database, if found it should raise exception else it should be saved
 
can you tell the process, ThnQ
Joan Murt at 20-Aug-12 5:43am
   
You should update your question (Improve question) and put your code snippet there and plenty of us will help you. Good luck!
srinu2008 at 20-Aug-12 7:08am
   
procedure save_clas_det
 
if(empty(tcur_clas))
 
do mesg_wind with 'Incomplete Details . Please Check......'

return
 
endif
 

decl temp_arr[1]
 
if(told_or_new = 1)
 
sele 5
seek class_arr[tclass_no,2]

trec_no = recno()
 

temp_arr = 0

select count(*) from &tcl_det_file ;
where name = tcur_clas .and. recno() # trec_no ;
into array temp_arr
 

if(temp_arr[1] > 0)
 
do mesg_wind with 'Duplicate Entry . Please Check......'

return
 
endif

else
 
temp_arr = 0
 
select count(*) from &tcl_det_file ;
where name = tcur_clas ;
into array temp_arr

 
if(temp_arr[1] > 0)
 
do mesg_wind with 'Duplicate Entry . Please Check......'

return
 
endif

 
sele 5
append blank

 
temp_arr = 0
 
select max(class) from &tcl_det_file ;
into array temp_arr

repl class with temp_arr[1] + 1

endif
 
repl name with tcur_clas
 
if(told_or_new = 1)
 
if(tcur_clas # substr(class_arr[tclass_no,1],3))
 
class_arr[tclass_no,1] = space(2) + tcur_clas

show gets

endif
 
else
 
do get_cl_det with .f.
 
tcur_clas = space(tclas_name_len)

show gets

endif
 
do mesg_wind with 'Class Details Saved......'
 

The above is the code of foxpro, there i want the 'Duplicate entry' that functionality i want, plz see the code and tell the conversion, ThnQ
Joan Murt at 20-Aug-12 7:45am
   
No idea, I've updated your question though, so all the CPians will be able to take a look at it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 279
1 Maciej Los 168
2 George Jonsson 154
3 Sarvesh Kumar Gupta 130
4 Dave Kreskowiak 130


Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 9 Oct 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid