Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this code be faster?
Message
From
27/10/2003 10:26:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/10/2003 10:08:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00842920
Message ID:
00842957
Views:
16
>>Tracy,
>>I think it'd be fast.
>>2 things confused me :
>>1) Why do you get file size (if not for something used later in snipped code)
>>2) m.data = FREAD(m.handle,VAL(m.size)-7)
>>Why -7 ? Wouldn't you be reading next 167 bytes ? Or is it 167 bytes including m.header+m.size?
>>
>>Using do case instead of if..endif would slow down a bit but might be ignorable.
>>
>> DO ('p_'+m.Header) WITH m.header+m.size+m.data
>>
>>might be ?
>>
>>Cetin
>
>Actually, you are correct that it really is 167 bytes including m.header and m.size. that is why I pass all three values (m.header, m.size, and m.data) to the procedures.
>
>Although I wish I could, I cannot do ('p_'+m.header) simply because the file may contain headers that I do not trap for and there may be NO matching procedure for that header. There are literally hundreds of possible headers but I only need to capture those relevant to our system.

Yes but you can still gain milliseconds that'd sum up to valuable time maybe :)
Do case
  case ...
...
endcase

* Replaced by :
if seek('p_'+m.Header,'definedprocs','proclist')
   do ('p_'+m.Header) with ...
endif
DefinedProcs could be included in project.
PS: Just seeking places to speed it up w/o C coding :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform