o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Returning Recursive values -

I know this might be a simple recursion question to some of you but I'm just a beginner to VB and to the whole programming world so please bear with me if my question seems a little bit dumb....
Lets say you have a search tree structure and you want to traverse the the tree to get a value in that tree. Here's the algorithm:

Public Function Traverse(Level as integer) as String
If the level you reach doesn't equal 0 then
Branch.Traverse (Level - 1)
End if
Traverse = Node
End function

And if I call this function from another class it always returns the root cause the calling class can't "see" the lower levels of recursion. For example, say I want a node from level 5, each time the program reaches the "Traverse = Node" line when the recursion starts exiting, the variable is always updated with the previous level such as level 4, level 3, level 2, level 1. Level 5 is always written over by the previous level so when the recursion ends, I'm left with the level 1 data but I really wanted the level 5 data. In other words, how do I preserve the level 5 data so that the calling function can "see" it? Thanks

 

Non-recursive into recursive -
I am going to start to wrok on a project that converts a non-recursive procedure into a recursive one and the opposite. Any ideas, links ,books ref, anything that would help ? I could use either pseudocode,vb,c++, or any other stuff . Thanx in advance


A doubt in VB and ASP -
Hi, I have a doubt. In Web-pages, Which is a better method of the following to return values using VB components. 1. Returning values as Arrays. or 2. Returning values as Recordsets. and if possible please do let me know the reason why one between the two is bette


how to get out of recursive methods -
okay: public int foo() { bar(); return something; } public void bar(){ bar(); ...some base case to end the recursive method... } is there any way to end bar() (and all recursive bar()s that were called) without reaching the base case, and get back to foo()?


Recursive sub dirs using Dir() -
hello all. ive done a search on this one and come up with various results but nothing solid. most of them are using the api, i just want to write a simple recursive function to retrieve all subdirs and their subdirs etc and return their paths in a string array, thats all.... only


Functions returning two values -
Hi! Is it possible to make a user-defined function return two values? How do i do it? Wat i understand about returning values is this: Public function myfunction(parameter) as integer myfunction="resulting value" end function Private Sub Command1_Click() retu


- [2008] - Recursion Question -
I know a recursive method is something that calls itself with different arguments. But I'm slightly confused on how a recursive method would be written (the syntax). If anyone can think up a simple example of a recursive method, that would help me understand recursion much better.


NEED HELP With Recordset!!!! -
Hi Guys I'm returning a Recordset with Integer Values.My problem is that some of these values are repeated...but those are the values i want to keep,including how many times they appear. Eg: Values returned 1 2 2 3


Finding .Top & .Left Values -
I tried to find the paramaters (values) of Image3.Top and Image3.Left, but whenever I go: MsgBox Image3.Top and the same for Image3.Left, It keeps returning zeroes, but for width and height it's returning me the proper values. How can I find out the right parameters?


recursive #include calls -
I have two classes that are codependant. They both have functions that call instances of the other class. Each class is defined in its own header file. Say Class1.h and Class2.h Right now I have #include "Class2.h" in my Class1.h file and #include "Class1.h"


Recursive Filesearch -
Anyone know of a good recursive filesearching module thats free? I'd like to grab one for future apps... -C


Recursive Descent Parser For expression evaluation -
I need to evaluate a mathematical expression. Probably a recursive descent Parser implementation would be appropriate for this. Can I get some idea on how a recursive Parser be implemented in such case?


algorithm question - array -
Hi everyone, I got a question here, I'm not that bad when it comes to algorithms and problem solving but this one is somehow hard …. At least for me. I'm trying to think how can I do this without recursive functions and only with FOR loops (because it should be easier) but still can


restoring defaults -
Is there any event that happens when returning to a form from another? the problem i have is that after making changes in a settings form and returning to the main form you need to click a command button to reload the settings from a txt file. I want this to happen automatically when


Debugging a recursive function -
Is it just me or is trying to debug a recursive function that calls itself a TON seemingly impossible and annoying.


need recursive function -
I need a recursive function written in C that adds a Link list node on top of the previous. Can anyone help?


Recursive serach -
How can i search recursive through directories for files with a specified extention ?


SELECT CASE for different data types -
Hello, Is it possible to return values of different data types in SELECT CASE .. WHEN clause? I was asked this question in an interview and my answer was No, because we cannot return values belonging to different data types. e.g., in a table you have 2 columns, named Dept., whic


Return -
Ok: I am returning some values from a query. I then take those values and place them in a table. The problem is that when onep of those values is not returned it will not return the entire row. How do I allow some to be blank (cells)?


recursive lists -
can you only have 1 recursive lists with 2 locations/file names? is there a way to get more?


Recursive Relation -
How i can make Recursive Relation between tow fields in the same table


Recursive loop -
I have written a program which runs a recursive loop. I have used sleep to let it sleep for 5 minutes. What it does is it checks another program state and changes it if it is not in the desired state. It does this every 5 minutes. Program works fine except when the computer goes into s


Recursion help -
hello, i was studing Recursion at http://phoenix.goucher.edu/~kelliher/cs23/feb21.html i have question in my mind. When the compiler compiles your program, how is a recursive call treated differently than a non-recursive method call? does Primitive values are all treated as reference v


[2005] Track a recursive file search -
Hi everyone, I've been looking around the forums trying to find a solution to my problem but have been so far unsuccessful. I have a recursive file search method (called "FileSearch") in a seperate class. The method is called from the main form (another class) to perform r


Returning a Recordset -
I've read a few threads on returning a recordset from a stored procedure (called form a vb client) -- as I am searching how this might be done. A little background, which will likely fire off some replies right off. On the vb client side, I am using data environments to connect t


SQL Helper Inserting records and returning the ID -
Hi all ive just started using the SQLHelper and am in need of inserting a record and returning the @@identity im using the transaction method but it does not return anything "its not ment to" reading the help file it got members and one of them is ExecuteReaderTyped


c++ recursive dir file scanner -
any one have a recursive file scanner that can accept wild cards and search all directories below it and return file name and path, for windows.? i tried looking for one but i have not founld one.


Statics, ByRef, Subs, and Functions -
Hi, trying to find out which is both faster and good on memory: Using Static Variable in a function such as a Recursive Loop OR Using a Private Declare in the Module instead of the Static declare OR Using a byref in the new call to the procedure Using a Sub .. then using By


rounding values -
hi, i am VERY new to VB and therefore dont know this answer, hope someone will help!!! I have a calculation using two currency values, I want the answer also to be of only two numbers after decimal place, but it is actually returning a normal integer, how do i set it so that it is


Returning values -
hi, is there any way to return values from a vb program? I mean, if I write a vb program and i need to pass it a value to the calling program, can i do anything like in C++ (int main(int, char*)) ? or can I pass values from an .ocx control to the program it's embedded in? thanks


12th grade stuff... -
I'm from New Zealand and not from America, so I'm not sure if I am 12th Grade (in NZ we say Year 12). But anyway, my school is rather slack, so if you think this is like 9th Grade stuff, say so. Anyway, I am having some problems with number sequences. I can do Arithmetic and Geome


Recursive Deleting -
Can any one post a code sample of recursive deleting a folder, like the rm -r [folder] in linux??? Currently, the Rmdir API onli supports removing of empty folders, i need to delete all the folders' contents, the subdirectories, files and all, thanx


API function for recursive search -
Hi, is there any API function that can perform recursive search in filesystem. Just similar to the command "Dir xxx.exe /s" Thx a lot


How to write a recursive function -
Hi, I'm trying to write a recursive function but in vain... thus i sincerely hope you could help me... Actually my purpose of this recursive search is to search for all children, grandchildren, great grandchildren...etc of a particular record. Suppose in my table, I have two


Returning Multiple values from a function -
How can I send a string to a function e.g. 12 February, 2001 and have it return the 3 values: day = 12 month = 02 and year = 2001 ?


What is wrong with my recursive program -
it works fine but my teacher says that it is not recursive? IS he wrong? It works fine for me. Can u help fix my problem?


GetWindowRect returns bogus values -
I'm using the GetWindowRect(WindowHandle, Points) API to return the upperleft and lowerright corners of the window. The screen I'm looking at is the IE, maixmized to fit the entire screen. The values being returned are -4,-4 (left,top) and 804,604 (right,bottom). I'm t


GetForegroundWindow() -- Megatron Help -
I am using GetForegroundWindow to check if a form has focus and if not unload. The problem is that it keeps returning 0 after I click on the system tray icon that shows the form. Does anyone know why is would keep returning 0? BTW, I have tried setting focus to it and everything l


Search file in folder an recursive folder with dir function -
Hi, I want to search ActiveX .dll in a expecific folder and in all his recursive folders. I´ve made a recursive function using dir statement. But dir returns error when it finish in one folder and I want that dir function search in the recursive folders too. This is my code:


MySQL ADO Recordset Not returning Time values -
Hi All, I am having a strange problem with a ADO recordset and MySQL. I am generating the SELECT query which when I run in MySQL is returning the expected result. SELECT ID, START, FINISH FROM TABLE Note: START and FINISH are both TIME datatypes in the MySQL db. I have i


Returning back to form with values intact -
Hi, In my asp page: I have 2 textboxes, one for EmpName and one for EmpCompany. To get all the possible values of EmpCompany, I have to go to another asp page containing all the possible values then return back with the desired value and display the value in EmpCompany textbox.