473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to call this function

kirubagari
158 100+
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdscan_Click()
  2.  
  3. Const a As Byte = 4
  4. Const b As Byte = &HFF
  5. Dim I As Long
  6. Dim AnyChanged As Boolean
  7. Dim changeMade As Boolean
  8. Dim value As Byte
  9. Dim x
  10. Dim tmp As String
  11.  
  12. For I = 1 To 100 Step 6
  13. AnyChanged = False
  14. Debug.Print "Before : "; Hex$(arrByte(I)); " "; Hex$(arrByte(I + 1)); " "; Hex$(arrByte(I + 2)); _
  15. " "; Hex$(arrByte(I + 3)); " "; Hex$(arrByte(I + 4)); " "; Hex$(arrByte(I + 5))
  16. ' Print HexByte2Char(I)
  17.  
  18. If arrByte(I) <> a Then
  19. arrByte(I) = a
  20. value = a
  21. x = HexByte2Char(value)
  22. ' tmp = Format$(x, "@@")
  23. 'PicOffSet2.CurrentX = x * Stdw1
  24. Debug.Print tmp;
  25. changeMade = True
  26.  
  27. End If
  28. If arrByte(I + 1) <> b Then
  29. arrByte(I + 1) = b
  30. changeMade = True
  31. End If
  32. If changeMade Then
  33. AnyChanged = True
  34. Debug.Print "After : "; Hex$(arrByte(I)); " "; Hex$(arrByte(I + 1)); " "; Hex$(arrByte(I + 2)); _
  35. " "; Hex$(arrByte(I + 3)); " "; Hex$(arrByte(I + 4)); " "; Hex$(arrByte(I + 5)); _
  36. " <--- Corrected"
  37. End If
  38. Debug.Print
  39. Next
  40.  
  41. End Sub

next coding


Expand|Select|Wrap|Line Numbers
  1. Public Function HexByte2Char(ByVal Value As Byte) As String
  2. HexByte2Char = IIf(Value < &H10, "0", "") & Hex$(Value)
  3. End Function

when I create the module and insert the hexbyte2Char and i call the function it doesn't work out. Actually how should i call it?
Jul 13 '07 #1
1 1164
Killer42
8,435 Expert 8TB
When i craete the module and insert the hexbyte2Char and i call the function it doesnt work out.Actualy how should i call it .
You should put the function in a code module, not in the form module. Then you can call it from anywhere. To use it, just call it in place of the Hex$() function. To demonstrate, I'll take an example from the posted code...

Expand|Select|Wrap|Line Numbers
  1. Debug.Print "Before : "; HexByte2Char(arrByte(I)); " ";
  2.  
Jul 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: mangi03 | last post by:
Hi, I came acrosss g++ compile errors whenever I make a function call by reference and found out from the test program that compiler is treating the function argument differently when another...
3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
4
by: Dave | last post by:
I have a program that I've written a class for. I need to call the function in the program from the class. When I try to call the function I receive the error, the name xxx does not exist in the...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
5
by: Kurt Van Campenhout | last post by:
Hi, I am trying to get/set Terminal server information in the active directory on a windows 2000 domain. Since the ADSI calls for TS don't work until W2K3, I need to do it myself. I'm fairly...
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
46
by: Steven T. Hatton | last post by:
I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it says. http://java.sun.com/docs/books/tutorial/essential/concurrency/syncrgb.html <shrug> -- NOUN:1. Money or...
0
by: Mike S | last post by:
I've seen examples of using the CallWindowProc Windows API function to call functions through their addresses in VB6 -- a clever workaround to emulate C-like function pointer semantics. A...
9
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this...
6
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.