Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help me please,how to find strings using file_find? #313733
03/03/10 07:27
03/03/10 07:27
Joined: Mar 2010
Posts: 26
S
Sergmodern Offline OP
Newbie
Sergmodern  Offline OP
Newbie
S

Joined: Mar 2010
Posts: 26
I have a database of computer technology and I do not know how to write your code to find product code and display the product itself, for example to enter the product code and display the items found, help as you can do it?

Re: Help me please,how to find strings using file_find? [Re: Sergmodern] #313738
03/03/10 10:09
03/03/10 10:09
Joined: Mar 2010
Posts: 26
S
Sergmodern Offline OP
Newbie
Sergmodern  Offline OP
Newbie
S

Joined: Mar 2010
Posts: 26
I have the database fields are: product code, name, model, price, manufacturer, date of receipt at the warehouse, the first to write a search function for its product code, here is my code, which does not come out:

Code:
function search_tov()
{
var temp,FoundIt,Posi,i;
inkey_active=0;str_cpy(mulkod,"                           ");inkey(mulkod);//str_cat(mulkod," "); //Ââîä êîäà òîâàðà
fhandle = file_open_read("Tovar.dll"); 
// FoundIt *= false;
//   while (Posi+1<=file_find(fhandle,mulkod) && !FoundIt)
//   {
//      file_seek(fhandle,Posi,0); 
//      //file_str_read(fhandle,mul2);
//      FoundIt*=(mul2=mulkod);
//      if (!FoundIt) Posi=Posi+1;
//   }
   //file_str_read( fhandle, (find_kod.pstring)[i] );
//for(i=0; i<j; i++)
//{
//	//txt_for_dir(sh_tov,mul2);
//   file_find(fhandle,mulkod);
//   file_str_read(fhandle,mul2);
//   if (mulkod=mul2)         
//   file_str_read( fhandle,(find_kod.pstring)[i] );   
//  }
FoundIt=0;
while(i<=j)
{
	file_str_read(fhandle,mulkod);
	file_find(fhandle,mul2); //mul2 it's a code of product in the programm.
	if (mulkod=i) file_str_read( fhandle,(find_kod.pstring)[i] ); 
	i=i+1;
}
file_close(fhandle);
}



Re: Help me please,how to find strings using file_find? [Re: Sergmodern] #313739
03/03/10 10:25
03/03/10 10:25
Joined: Mar 2010
Posts: 26
S
Sergmodern Offline OP
Newbie
Sergmodern  Offline OP
Newbie
S

Joined: Mar 2010
Posts: 26
Code:
Function main()
{
inkey _ active = 0; str _ cpy (mul, ""); inkey (mul); str _ cat (mul, ""); / / Enter the name of the goods 
  
 inkey _ active = 0; str _ cpy (mul 1, ""); inkey (mul 1); str _ cat (mul 1, "") / / Input model 
  
 inkey _ active = 0; str _ cpy (mul 2, ""); inkey (mul 2); str _ cat (mul 2, "") / / Enter product code 
  
 inkey _ active = 0; str _ cpy (mul 3, ""); inkey (mul 3); / / Entry date 
  
 inkey _ active = 0; str _ cpy (mul 4, ""); inkey (mul 4), / / Input value 
  
 inkey _ active = 0; str _ cpy (mul 5, ""); inkey (mul 5); / / Enter manufacturer 
  
 str _ cpy (mul 6, mul); / / copying a string which displays the data on this product 
  
 filehandle = file _ open _ append ( "T ovar. dll"); 
  
 file _ asc _ write (filehandle, 1 3); / / Write to file products 
  
 file _ asc _ write (filehandle, 1 0); 
  
 file _ str _ write (filehandle, mul 6); 
  
 file _ str _ write (filehandle, mul 1); / / Write to file stylists 
  
 file _ str _ write (filehandle, mul 2); / / Write to file Article 
  
 f i l e _ c l o s e (f i l e h a n d l e); 
  
 set (endvvtov, SHOW); / / put all the necessary information about product 
  
 fhandle = file _ open _ read ( "T ovar. dll"); / / reading from file 
  
 file _ str _ read (fhandle, mul 6); 
  
 f i l e _ c l o s e (f h a n d l e); 
  
 / / Set (naimenov, SHOW); / / Output information about product 
search_tov();
}



Re: Help me please,how to find strings using file_find? [Re: Sergmodern] #314258
03/07/10 09:19
03/07/10 09:19
Joined: Mar 2010
Posts: 26
S
Sergmodern Offline OP
Newbie
Sergmodern  Offline OP
Newbie
S

Joined: Mar 2010
Posts: 26
Help me please,i need to take this program in this month:(

Re: Help me please,how to find strings using file_find? [Re: Sergmodern] #314266
03/07/10 11:18
03/07/10 11:18
Joined: Sep 2009
Posts: 1,032
Budapest
Aku_Aku Offline
Serious User
Aku_Aku  Offline
Serious User

Joined: Sep 2009
Posts: 1,032
Budapest
Hey i don't understand what is your problem. Moreover your code is mysterious for me.
But when overview this post something catched my eyes.
Code:
filehandle = file _ open _ append ( "T ovar. dll");


I advise to you, don't use SPACES in filenames.
Good luck.

Last edited by Aku_Aku; 03/07/10 11:18. Reason: a missing i letter
Re: Help me please,how to find strings using file_find? [Re: Aku_Aku] #314382
03/08/10 08:33
03/08/10 08:33
Joined: Mar 2010
Posts: 26
S
Sergmodern Offline OP
Newbie
Sergmodern  Offline OP
Newbie
S

Joined: Mar 2010
Posts: 26
AHA=)
No I do not use spaces in file names, I just dragged this code in the document word, and therefore turned out spaces in file names. I have already written code search product on its code in the database, that look like works.

function search_tov()
{
var temp;
fhandle = file_open_read("strings1.dll"); // &#1092;&#1072;&#1081;&#1083; &#1089;&#1086;&#1076;&#1077;&#1088;&#1078;&#1080;&#1090;: j
j=file_var_read(fhandle); // &#1090;&#1077;&#1087;&#1077;&#1088;&#1100; j
file_close(fhandle);
fhandle = file_open_read("Tovar.dll"); // test.txt &#1089;&#1086;&#1076;&#1077;&#1088;&#1078;&#1080;&#1090; "this,was,a,test"
inkey_active=0;inkey(mul);
temp = file_find(fhandle,mul);
if (temp<0) str_cpy(ac,"&#1057;&#1090;&#1088;&#1086;&#1082;&#1072; &#1085;&#1077; &#1085;&#1072;&#1081;&#1076;&#1077;&#1085;&#1072;"); else
str_cpy(ac,"&#1053;&#1072;&#1081;&#1076;&#1077;&#1085;&#1072; &#1089;&#1090;&#1088;&#1086;&#1082;&#1072;:");
for(i=0;i<j;i++)
{
file_str_read( fhandle, acc);
break;
wait(1);
}
file_close(fhandle);
delete_tov();
}

Re: Help me please,how to find strings using file_find? [Re: Sergmodern] #314383
03/08/10 08:37
03/08/10 08:37
Joined: Mar 2010
Posts: 26
S
Sergmodern Offline OP
Newbie
Sergmodern  Offline OP
Newbie
S

Joined: Mar 2010
Posts: 26
Please tell us how you can do to delete a specific record in the database file? And then I did not get it done, I removed all the contents of the database is needed, help please.

Re: Help me please,how to find strings using file_find? [Re: Sergmodern] #314496
03/08/10 21:56
03/08/10 21:56
Joined: Sep 2009
Posts: 1,032
Budapest
Aku_Aku Offline
Serious User
Aku_Aku  Offline
Serious User

Joined: Sep 2009
Posts: 1,032
Budapest
As i know there is a MySQL plugin for 3D GS.
MySQL plugin by Joozey
Perhaps there are more, you can search for them freely.

Addendum:
There isn't any delete instruction for erase one line from a file.

Last edited by Aku_Aku; 03/08/10 21:58. Reason: the addendum
Re: Help me please,how to find strings using file_find? [Re: Aku_Aku] #315613
03/17/10 15:06
03/17/10 15:06
Joined: Mar 2010
Posts: 26
S
Sergmodern Offline OP
Newbie
Sergmodern  Offline OP
Newbie
S

Joined: Mar 2010
Posts: 26
Ok thanks,but can you tell me?Are there any plugins for 3DGS what work with data bases?


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1