4 Replies - 590 Views - Last Post: 31 March 2010 - 11:35 AM Rate Topic: -----

#1 willcool52  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 27-February 10

Why Does This Code Not Work?

Posted 30 March 2010 - 05:09 AM

Hey people,

I need this code in a special ZIP control I am writing. This is the only code that doesn't work.

Dim compressed() As Byte = ConvertToByteArray(source)


any ideas?
Is This A Good Question/Topic? 0
  • +

Replies To: Why Does This Code Not Work?

#2 Bort  Icon User is offline

  • Ill-informed Mongoloid
  • member icon

Reputation: 404
  • View blog
  • Posts: 2,983
  • Joined: 18-September 06

Re: Why Does This Code Not Work?

Posted 30 March 2010 - 05:13 AM

Try this:

Dim compressed As Byte = ConvertToByteArray(source)



If that's no help, what are the errors you are getting?

This post has been edited by Bort: 30 March 2010 - 05:14 AM

Was This Post Helpful? 0
  • +
  • -

#3 Lumenii  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 92
  • Joined: 04-January 07

Re: Why Does This Code Not Work?

Posted 30 March 2010 - 02:10 PM

View PostBort, on 30 March 2010 - 04:13 AM, said:

Try this:

Dim compressed As Byte = ConvertToByteArray(source)



If that's no help, what are the errors you are getting?


Bort, correct me if I'm wrong, but the "ConvertToByteArray" function would seem to return a Byte() object. As such, wouldn't you want the variable being set to the function's output to be a Byte array, rather than a Byte? Then technically either of the following would be correct:

                Dim compressed() as Byte = ConvertToByteArray(source)
                Dim compressed as Byte() = ConvertToByteArray(source)


This post has been edited by Lumenii: 30 March 2010 - 02:13 PM

Was This Post Helpful? 0
  • +
  • -

#4 Bort  Icon User is offline

  • Ill-informed Mongoloid
  • member icon

Reputation: 404
  • View blog
  • Posts: 2,983
  • Joined: 18-September 06

Re: Why Does This Code Not Work?

Posted 31 March 2010 - 01:41 AM

Actually, yes. You are quite right there...oops...Sorry.
Was This Post Helpful? 0
  • +
  • -

#5 Lumenii  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 92
  • Joined: 04-January 07

Re: Why Does This Code Not Work?

Posted 31 March 2010 - 11:35 AM

Happens to everyone. Don't sweat it.

Anyways, willcool52, it would help for us to see your ConvertToByteArray function's code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1