abase function problem

abase function problem

Postby Ehab Samir Aziz » Mon Feb 19, 2007 10:39 pm

I am switching between workareas of files in the calls of abase1 function and always have the problem of creating the temp index file.
Code: Select all  Expand view

  @ 1,60 COMBOBOX V_CT_CU_ACCT ITEMS aBase1(1,"cust",256,"cu_acct") size 80,80 OF oDlg PIXEL


   @ 15,60 COMBOBOX V_CT_CU_NAME ITEMS aBase1(1,"cust",256,"cu_name") size 150,120 OF oDlg PIXEL


  @ 75,200 COMBOBOX oCbx VAR v_mm_combo ITEMS aBase1(2,"cont",256,"ct_mamc");

..
..

function aBase1(workarea,cFile,xx,cField)
*---------------------------------------
  local aItems:={}
  local y:=0
  local tempntx:=""
  aAdd(aItems,space(256)) //Put First element empty
 
  select (workarea)
  use (cFile)
  index on &(cField) to temp

  go top
 
    do while ! eof()
    do case
        case VALTYPE(cField) == "D"
              y:=ASCAN(aItems,DTOC((cFile)->&cField))
   
   
        case VALTYPE(cField) == "N"
               y:=ASCAN(aItems,str((cFile)->&cField))
   
   
        otherwise
       y:=ASCAN(aItems,cValToChar((cFile)->&cField))
        endcase
   

       
       if y==0
       do case
               case VALTYPE(cField) == "D"
                     aAdd(aItems,DTOC((cFile)->&cField))
           
           
               case VALTYPE(cField) == "N"
                      aAdd(aItems,str((cFile)->&cField))
           
           
               otherwise
          aAdd(aItems,cValToChar((cFile)->&cField))
               endcase
   
       
          dbSkip()
          else
          dbSkip()
       endif
  aItems:= Asort( aItems )
    enddo

    *use
  ferase("temp.ntx")
  *select(nArea)
  *use nselect
return aItems


Application
===========
Path and name: E:\programs\Database\clipper\FWH\sitex\sitex.exe (32 bits)
Size: 1,696,256 bytes
Time from start: 0 hours 0 mins 10 secs
Error occurred at: 20/02/2007, 00:38:21
Error description: Error ADSCDX/7040 Create error: temp

Stack Calls
===========
Called from: => ORDCREATE(0)
Called from: source\rdd\rddord.prg => DBCREATEINDEX(61)
Called from: sitex.prg => ABASE1(5044)
Called from: sitex.prg => EDITCONT(1096)
Called from: sitex.prg => (b)LISTCONT(945)
Called from: => TBUTTON:CLICK(0)
Called from: => TBUTTON:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => SENDMESSAGE(0)
Called from: => TDIALOG:COMMAND(0)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: => TDIALOG:HANDLEEVENT(0)
Called from: => DIALOGBOXINDIRECT(0)
Called from: => TDIALOG:ACTIVATE(0)
Called from: sitex.prg => LISTCONT(959)
Called from: sitex.prg => (b)BUILDMENU(149)
Called from: => TMENU:COMMAND(0)
Called from: => TWINDOW:COMMAND(0)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: => TWINDOW:ACTIVATE(0)
Called from: sitex.prg => MAIN(134)
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby James Bott » Tue Feb 20, 2007 5:46 am

Ehab,

As I mentioned in an earlier message, you don't have to index if you sort the array at the end.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests